diff options
| author | Gord Thompson <gord@gordthompson.com> | 2020-04-19 11:47:19 -0600 |
|---|---|---|
| committer | Gord Thompson <gord@gordthompson.com> | 2020-05-29 08:10:38 -0600 |
| commit | 668872fe0108c3885adcf6cb10b653b812dc258f (patch) | |
| tree | 1b70ad2d164b1f9060b29a4535bc55bcf5a11350 /lib/sqlalchemy/testing/requirements.py | |
| parent | 5e1d11573350f8035ed607e9c97b9f8896ab3132 (diff) | |
| download | sqlalchemy-668872fe0108c3885adcf6cb10b653b812dc258f.tar.gz | |
Add support for "real" sequences in mssql
Added support for "CREATE SEQUENCE" and full :class:`.Sequence` support for
Microsoft SQL Server. This removes the deprecated feature of using
:class:`.Sequence` objects to manipulate IDENTITY characteristics which
should now be performed using ``mssql_identity_start`` and
``mssql_identity_increment`` as documented at :ref:`mssql_identity`. The
change includes a new parameter :paramref:`.Sequence.data_type` to
accommodate SQL Server's choice of datatype, which for that backend
includes INTEGER and BIGINT. The default starting value for SQL Server's
version of :class:`.Sequence` has been set at 1; this default is now
emitted within the CREATE SEQUENCE DDL for all backends.
Fixes: #4235
Fixes: #4633
Change-Id: I6aa55c441e8146c2f002e2e201a7f645e667b916
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
| -rw-r--r-- | lib/sqlalchemy/testing/requirements.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 31011a970..2d51e7c9b 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 fails_on_everything_except from .. import util @@ -1189,3 +1190,13 @@ class SuiteRequirements(Requirements): lambda config: not config.db.dialect.supports_is_distinct_from, "driver doesn't support an IS DISTINCT FROM construct", ) + + @property + def emulated_lastrowid_even_with_sequences(self): + """"target dialect retrieves cursor.lastrowid or an equivalent + after an insert() construct executes, even if the table has a + Sequence on it.. + """ + return fails_on_everything_except( + "mysql", "sqlite+pysqlite", "sqlite+pysqlcipher", "sybase", + ) |
