- changed component to documentation
document / provide clear path for custom SQL constructs that support autocommit
Issue #2230
resolved
Following advice on http://www.sqlalchemy.org/docs/core/compiler.html I create a custom InsertFromSelect element. Unfortunately it seems that it doesn't make the actual insert, even though the SQL generated looks fine.
From a shallow look it seems no COMMIT-statement is issued when InsertFromSelect is executed.
It works fine, if instead of subclassing Executable, ClauseElement, we subclass UpdateBase.
See attached unittest-script for the code to recreate and "resolve" the problem.
Comments (4)
-
repo owner -
repo owner - changed title to document / provide clear path for custom SQL constructs that support autocommit
- changed milestone to 0.7.4
-
repo owner - changed status to resolved
we've had the _execution_options workaround documented for quite some time now so that's what we'll keep for now.
-
repo owner - removed milestone
Removing milestone: 0.7.5 (automated comment)
- Log in to comment
since you're using connectionless execution with no transaction you need to apply autocommit to the construct in order for it to autocommit.
or:
the path here should be clearer somehow, either AutocommitExecutable, or something like that.