]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Make schema support explicit
authorGord Thompson <gord@gordthompson.com>
Thu, 8 Apr 2021 23:22:34 +0000 (17:22 -0600)
committerGord Thompson <gord@gordthompson.com>
Fri, 9 Apr 2021 13:33:36 +0000 (07:33 -0600)
Add ``supports_schema = True`` to DefaultDialect and modify
requirements.py to use that attribute so third-party dialects
can explicitly indicate that they do *not* support schemas by
specifying ``supports_schema = False`` in their Dialect class.

Change-Id: Idffee82f6668a15ac7148f2a407a17de785d1fb7

lib/sqlalchemy/engine/default.py
lib/sqlalchemy/testing/requirements.py
test/requirements.py

index 0242d9812f68c585e048d3ad770dd42cf12ca8b4..d45b6d7a7efb4ed0ed8f156c608662a9b79caa79 100644 (file)
@@ -68,6 +68,7 @@ class DefaultDialect(interfaces.Dialect):
     # not cx_oracle.
     execute_sequence_format = tuple
 
+    supports_schemas = True
     supports_views = True
     supports_sequences = False
     sequences_optional = False
index b6381dd5772b8601312ea6c33b9685d3c1fbc61d..f82d5f06552ab6956610279493e27efcc1544765 100644 (file)
@@ -19,6 +19,7 @@ import platform
 import sys
 
 from . import exclusions
+from . import only_on
 from .. import util
 from ..pool import QueuePool
 
@@ -473,7 +474,7 @@ class SuiteRequirements(Requirements):
         """Target database must support external schemas, and have one
         named 'test_schema'."""
 
-        return exclusions.closed()
+        return only_on(lambda config: config.db.dialect.supports_schemas)
 
     @property
     def cross_schema_fk_reflection(self):
index c0057b94ec01e3d8d8be199add019ab299236f44..eca9e0518f13fef915967c3ba97f86d687b6afc8 100644 (file)
@@ -541,7 +541,7 @@ class DefaultRequirements(SuiteRequirements):
         """Target database must support external schemas, and have one
         named 'test_schema'."""
 
-        return skip_if(["firebird"], "no schema support")
+        return exclusions.open()
 
     @property
     def cross_schema_fk_reflection(self):