summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/requirements.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2020-05-30 14:45:00 +0200
committerFederico Caselli <cfederico87@gmail.com>2020-08-19 00:34:23 +0200
commit26e8d3b5bdee50192e3426fba48e6b326e428e0b (patch)
tree0893364e2ddcf171cdcf1cb461b09d8a00664d21 /lib/sqlalchemy/testing/requirements.py
parent0901190bb440580f0664fe3f6310173762b908e0 (diff)
downloadsqlalchemy-26e8d3b5bdee50192e3426fba48e6b326e428e0b.tar.gz
Add support for identity columns
Added the :class:`_schema.Identity` construct that can be used to configure identity columns rendered with GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY. Currently the supported backends are PostgreSQL >= 10, Oracle >= 12 and MSSQL (with different syntax and a subset of functionalities). Fixes: #5362 Fixes: #5324 Fixes: #5360 Change-Id: Iecea6f3ceb36821e8b96f0b61049b580507a1875
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
-rw-r--r--lib/sqlalchemy/testing/requirements.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index 3d3980b30..a27dd2e01 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -1254,3 +1254,17 @@ class SuiteRequirements(Requirements):
lambda config: not config.db.dialect.supports_is_distinct_from,
"driver doesn't support an IS DISTINCT FROM construct",
)
+
+ @property
+ def identity_columns(self):
+ """If a backend supports GENERATED { ALWAYS | BY DEFAULT }
+ AS IDENTITY"""
+ return exclusions.closed()
+
+ @property
+ def identity_columns_standard(self):
+ """If a backend supports GENERATED { ALWAYS | BY DEFAULT }
+ AS IDENTITY with a standard syntax.
+ This is mainly to exclude MSSql.
+ """
+ return exclusions.closed()