]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
[asyncpg] Extract rowcount for SELECT statements
authorMichael Gorven <michael@gorven.net>
Wed, 4 Jan 2023 17:30:42 +0000 (12:30 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 4 Jan 2023 17:35:44 +0000 (12:35 -0500)
commit7b2cb47ba16f48462b0e6b2c8f7c24143e9f7e26
tree0ea9b5807e0acdd67a90e4d2487856606b3b2311
parent0897f86d10695477b57c50e2d7bc0bd6571a04af
[asyncpg] Extract rowcount for SELECT statements

Added support to the asyncpg dialect to return the ``cursor.rowcount``
value for SELECT statements when available. While this is not a typical use
for ``cursor.rowcount``, the other PostgreSQL dialects generally provide
this value. Pull request courtesy Michael Gorven.

Fixes: #9048
Closes: #9049
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9049
Pull-request-sha: df16160530c6001d99de059995ad5047a75fb7b0

Change-Id: I095b866779ccea7e4d50bc841fef7605e61c667f
(cherry picked from commit 9c502f5788737fa65029716c73fe0f65f3dafb53)
doc/build/changelog/unreleased_14/9048.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/asyncpg.py
test/dialect/postgresql/test_dialect.py