diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-01 19:49:26 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-09-01 19:49:26 +0000 |
commit | 69f7084c9b79b0b70f2b24400fb150a0a40d0424 (patch) | |
tree | 1da7f3a6b0a873472b57ad0e093339be6cff0b48 /lib/sqlalchemy/exceptions.py | |
parent | 15ab87994ced6f27e0403ce16fd7ffada31e6858 (diff) | |
download | sqlalchemy-69f7084c9b79b0b70f2b24400fb150a0a40d0424.tar.gz |
- merged inline inserts branch
- all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement
and don't do any pre-execution
- regular Insert and Update objects can have inline=True, forcing all executions to be inlined.
- no last_inserted_ids(), lastrow_has_defaults() available with inline execution
- calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified
- fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False
- fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc.
- all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all
insert/update/default functionality
Diffstat (limited to 'lib/sqlalchemy/exceptions.py')
-rw-r--r-- | lib/sqlalchemy/exceptions.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/exceptions.py b/lib/sqlalchemy/exceptions.py index 709b0a3da..9c7caedd0 100644 --- a/lib/sqlalchemy/exceptions.py +++ b/lib/sqlalchemy/exceptions.py @@ -81,20 +81,20 @@ class DBAPIError(SQLAlchemyError): Its type and properties are DB-API implementation specific. """ - def __new__(cls, statement, params, orig, *args, **kw): + def instance(cls, statement, params, orig): # Don't ever wrap these, just return them directly as if # DBAPIError didn't exist. if isinstance(orig, (KeyboardInterrupt, SystemExit)): return orig if orig is not None: - name, glob = type(orig).__name__, globals() + name, glob = orig.__class__.__name__, globals() if name in glob and issubclass(glob[name], DBAPIError): cls = glob[name] - return SQLAlchemyError.__new__(cls, statement, params, orig, - *args, **kw) - + return cls(statement, params, orig) + instance = classmethod(instance) + def __init__(self, statement, params, orig): SQLAlchemyError.__init__(self, "(%s) %s" % (orig.__class__.__name__, str(orig))) |