From: Gord Thompson Date: Thu, 8 Apr 2021 23:22:34 +0000 (-0600) Subject: Make schema support explicit X-Git-Tag: rel_1_4_7~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a14303639e03fd295edf1f5fabf6d20b05b1870b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Make schema support explicit 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 --- diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 0242d9812f..d45b6d7a7e 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -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 diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index b6381dd577..f82d5f0655 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -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): diff --git a/test/requirements.py b/test/requirements.py index c0057b94ec..eca9e0518f 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -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):