]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fixed direct execution of Compiled objects
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2006 15:58:51 +0000 (15:58 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2006 15:58:51 +0000 (15:58 +0000)
CHANGES
lib/sqlalchemy/engine/base.py
test/sql/query.py

diff --git a/CHANGES b/CHANGES
index acddae34f64c83671e5657901eda48031da64c4d..a6021ca927f46bf4f7987613b24783398d8e0cbc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ passive_deletes=True on a relation().
 - MySQL catches exception on "describe" and reports as NoSuchTableError
 - further fixes to sqlite booleans, weren't working as defaults
 - fix to postgres sequence quoting when using schemas
+- fixed direct execution of Compiled objects
 
 0.3.0
 - General:
index 704767b014ede339ff351d30714c626cedc81bd2..07a88659be34da70f1ae1d945874a70f378a264e 100644 (file)
@@ -299,7 +299,7 @@ class Connection(Connectable):
     # poor man's multimethod/generic function thingy
     executors = {
         sql.ClauseElement : execute_clauseelement,
-        sql.Compiled : execute_compiled,
+        sql.ClauseVisitor : execute_compiled,
         schema.SchemaItem:execute_default,
         str.__mro__[-2] : execute_text
     }
index 2c92a4932242250f5cd308e6571db8fbbef50ede..96ad6ec8b138a7e95a66106c9a45534368c5e83f 100644 (file)
@@ -50,7 +50,12 @@ class QueryTest(PersistTest):
         for row in r:
             l.append(row)
         self.assert_(len(l) == 3)
-    
+   
+    def test_compiled_execute(self):
+        s = select([self.users], self.users.c.user_id==bindparam('id')).compile()
+        c = testbase.db.connect()
+        print repr(c.execute(s, id=7).fetchall())
     def test_global_metadata(self):
         t1 = Table('table1', Column('col1', Integer, primary_key=True),
             Column('col2', String(20)))