⚡ Sangsakala Proxy 🏠 Home
Skip to content

sqlobject should raise exceptions from dberrors only #5

Open

Description

@sigmavirus24

This could be a running list of them as I find them.

Activity

  1. modified the milestone: 3.0 on Feb 6, 2015
  2. drnlm commented on Oct 27, 2016

    @drnlm

    Does this need to be fixed? Currently, this is an undocumented feature, and, as autoCommit is initialised from a Boolean, it requires manually poking at the dbconnection.autoCommit to even hit this code path. It is used in the test suite, so this might be something that can be treated as an internal implementation detail.

    If this is something we should change, which exception should it raise (reading PEP249, InterfaceError is probably the best fit)?

  3. phdru commented on Oct 27, 2016

    @phdru
    Member

    Does this need to be fixed?

    If 'this' is the entire ticket, then yes, it will be a major enhancement to protect SQLObject users from database-specific exceptions and instead raise those of SQLObject.

    If 'this' is one particular exception than I think it could be left out. But I'd prefer it to be IntegrityError, ProgrammingError or NotSupportedError.

  4. drnlm commented on Oct 28, 2016

    @drnlm

    "this" was referring to the listed exception, since it's the only place that sqlobject raises a raw exception. It is simple to change it to something else, it's just a matter of what it should be,

    For the other cases, it looks like the sqlite, mysql and postgres connections will do the right thing in _executeRetry. The other connectors don't.

    The calls to fetchone and fetchall in dbconnection._queryAll, dbconnection._queryOne and dbconnection._queryAllDescription will also need conversion logic, as these can throw an exception if the query returns nothing psycopg2 returns InterfaceError or ProgrammingError depending on the exact problem , and the other dbapi implementations I've looked at return either or just hide the error and return an empty set of results. SQLObject should probably pick one to consistently retutn (ProgrammingError?)

    I've edited the original isse to add a more complete list of tasks.

  5. phdru commented on Oct 28, 2016

    @phdru
    Member

    The other connectors don't.

    That's exactly the concern of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions