]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- tables with schemas can still be used in sqlite, firebird,
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Dec 2007 21:14:09 +0000 (21:14 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Dec 2007 21:14:09 +0000 (21:14 +0000)
schema name just gets dropped [ticket:890]

CHANGES
lib/sqlalchemy/sql/compiler.py
test/engine/reflection.py

diff --git a/CHANGES b/CHANGES
index 3b212fe82f619259eea0e2e7e5438794ef74c42d..f323bdab8d68ea5e3be843fde5839b6f081cc01d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,9 @@ CHANGES
       advised that all unicode-aware applications make proper use of Python
       unicode objects (i.e. u'hello' and not 'hello').
 
+    - tables with schemas can still be used in sqlite, firebird,
+      schema name just gets dropped [ticket:890]
+
     - changed the various "literal" generation functions to use an anonymous
       bind parameter.  not much changes here except their labels now look 
       like ":param_1", ":param_2" instead of ":literal"
index ea7c1b7345fc03aca30ef482cf5f4215a92317c3..1cbfd94d245b01f0a635cb14f510b2430945054a 100644 (file)
@@ -1021,7 +1021,7 @@ class IdentifierPreparer(object):
         if name is None:
             name = table.name
         result = self.quote(table, name)
-        if use_schema and getattr(table, "schema", None):
+        if not self.omit_schema and use_schema and getattr(table, "schema", None):
             result = self.quote(table, table.schema) + "." + result
         return result
 
index 756f42224eb3811280fdf4326061492a78431d1c..0d2fa2818834f0922795137bad51708acb7578e0 100644 (file)
@@ -726,8 +726,8 @@ class UnicodeTest(PersistTest):
 
 
 class SchemaTest(PersistTest):
+    
     # this test should really be in the sql tests somewhere, not engine
-    @testing.unsupported('sqlite', 'firebird')
     def test_iteration(self):
         metadata = MetaData()
         table1 = Table('table1', metadata,
@@ -748,8 +748,12 @@ class SchemaTest(PersistTest):
         gen.traverse(table2)
         buf = buf.getvalue()
         print buf
-        assert buf.index("CREATE TABLE someschema.table1") > -1
-        assert buf.index("CREATE TABLE someschema.table2") > -1
+        if testbase.db.dialect.preparer(testbase.db.dialect).omit_schema:
+            assert buf.index("CREATE TABLE table1") > -1
+            assert buf.index("CREATE TABLE table2") > -1
+        else:
+            assert buf.index("CREATE TABLE someschema.table1") > -1
+            assert buf.index("CREATE TABLE someschema.table2") > -1
 
     @testing.supported('maxdb', 'mysql', 'postgres')
     def test_explicit_default_schema(self):