summaryrefslogtreecommitdiff
path: root/test/sql/select.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-09-01 19:49:26 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-09-01 19:49:26 +0000
commit69f7084c9b79b0b70f2b24400fb150a0a40d0424 (patch)
tree1da7f3a6b0a873472b57ad0e093339be6cff0b48 /test/sql/select.py
parent15ab87994ced6f27e0403ce16fd7ffada31e6858 (diff)
downloadsqlalchemy-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 'test/sql/select.py')
-rw-r--r--test/sql/select.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index fa5e3af03..5eaea7480 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -1125,7 +1125,14 @@ class CRUDTest(SQLCompileTest):
"INSERT INTO mytable (myid, name) VALUES (:userid, :username)"
)
-
+ def testinlineinsert(self):
+ metadata = MetaData()
+ table = Table('sometable', metadata,
+ Column('id', Integer, primary_key=True),
+ Column('foo', Integer, default=func.foobar()))
+ self.assert_compile(table.insert(values={}, inline=True), "INSERT INTO sometable (foo) VALUES (foobar())")
+ self.assert_compile(table.insert(inline=True), "INSERT INTO sometable (foo) VALUES (foobar())", params={})
+
def testinsertexpression(self):
self.assert_compile(insert(table1), "INSERT INTO mytable (myid) VALUES (lala())", params=dict(myid=func.lala()))