]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
audition pymssql once more; retire sane_rowcount_returning
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 3 Mar 2023 14:30:58 +0000 (09:30 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Mar 2023 04:22:20 +0000 (23:22 -0500)
commitb38fb59fe484d6e4e5992c9b2dc9b9f7724f016a
tree21bac11da9981fe45b20bdb06240b37fb47b5800
parent7099dd20e90307237240f30d5db0816a08356a5b
audition pymssql once more; retire sane_rowcount_returning

pymssql seems to be maintained again and seems to be working
completely, so let's try re-enabling it.

Fixed issue in the new :class:`.Uuid` datatype which prevented it from
working with the pymssql driver. As pymssql seems to be maintained again,
restored testing support for pymssql.

Tweaked the pymssql dialect to take better advantage of
RETURNING for INSERT statements in order to retrieve last inserted primary
key values, in the same way as occurs for the mssql+pyodbc dialect right
now.

Identified that the ``sqlite`` and ``mssql+pyodbc`` dialects are now
compatible with the SQLAlchemy ORM's "versioned rows" feature, since
SQLAlchemy now computes rowcount for a RETURNING statement in this specific
case by counting the rows returned, rather than relying upon
``cursor.rowcount``.  In particular, the ORM versioned rows use case
(documented at :ref:`mapper_version_counter`) should now be fully
supported with the SQL Server pyodbc dialect.

Change-Id: I38a0666587212327aecf8f98e86031ab25d1f14d
References: #5321
Fixes: #9414
18 files changed:
doc/build/changelog/unreleased_20/9414.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/provision.py
lib/sqlalchemy/dialects/mssql/pymssql.py
lib/sqlalchemy/dialects/mssql/pyodbc.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/test_rowcount.py
lib/sqlalchemy/testing/suite/test_types.py
setup.cfg
test/dialect/mssql/test_query.py
test/dialect/mssql/test_types.py
test/orm/test_versioning.py
test/requirements.py
test/sql/test_defaults.py
test/sql/test_resultset.py
tox.ini