]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add reflection for Identity columns
authorFederico Caselli <cfederico87@gmail.com>
Sat, 19 Sep 2020 20:29:38 +0000 (22:29 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 28 Sep 2020 22:11:12 +0000 (18:11 -0400)
commit7362d454f46107cae4076ce54e9fa430c3370734
treeae7545a99a76995ef31a879f09fb1c0fe6764f4b
parentc3f102c9fe9811fd5286628cc6aafa5fbc324621
Add reflection for Identity columns

Added support for reflecting "identity" columns, which are now returned
as part of the structure returned by :meth:`_reflection.Inspector.get_columns`.
When reflecting full :class:`_schema.Table` objects, identity columns will
be represented using the :class:`_schema.Identity` construct.

Fixed compilation error on oracle for sequence and identity column
``nominvalue`` and ``nomaxvalue`` options that require no space in them.

Improved test compatibility with oracle 18.

As part of the support for reflecting :class:`_schema.Identity` objects,
the method :meth:`_reflection.Inspector.get_columns` no longer returns
``mssql_identity_start`` and ``mssql_identity_increment`` as part of the
``dialect_options``. Use the information in the ``identity`` key instead.

The mssql dialect will assume that at least MSSQL 2005 is used.
There is no hard exception raised if a previous version is detected,
but operations may fail for older versions.

Fixes: #5527
Fixes: #5324
Change-Id: If039fe637c46b424499e6bac54a2cbc0dc54cb57
21 files changed:
doc/build/changelog/unreleased_14/5506.rst
doc/build/changelog/unreleased_14/5527.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/mssql_identity_dialect_options.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/mssql_version.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/oracle_sequence_options.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/information_schema.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/testing/suite/test_select.py
lib/sqlalchemy/testing/suite/test_sequence.py
lib/sqlalchemy/util/compat.py
test/dialect/mssql/test_reflection.py
test/dialect/oracle/test_compiler.py
test/dialect/oracle/test_dialect.py
test/dialect/oracle/test_reflection.py
test/dialect/postgresql/test_reflection.py
test/engine/test_reflection.py
test/sql/test_identity_column.py