Skip to content

Tags: MagicStack/asyncpg

Tags

v0.32.0

Toggle v0.32.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.32.0

* Support Python 3.15 (#1367, #1378)
  (by @elprans in 1b11846 and 58c0c59)

* Support PostgreSQL 19 (#1379)
  (by @elprans in 8d2a5ae)

* Make pool `min_size` a maintained connection floor and add `init_size` to
  control the number of connections opened at startup (#1323).
  Idle connections at or below `min_size` are retained, and closed connections
  are replaced in the background. `init_size` defaults to `min_size`.
  To preserve the previous behavior, where the pool could drain to zero,
  replace `min_size=N` with `init_size=N, min_size=0`.
  (by @shatilov-diman in 67a1cbc)

* Use `hashlib.pbkdf2_hmac()` for faster SCRAM password derivation (#1359)
  (by @twelfthlabor in 00319a9)

* Use the statement cache for `copy_records_to_table()` introspection (#1360)
  (by @matemax in dd05865)

* Clean up connections rejected by `target_session_attrs` immediately so an
  unresponsive rejected host cannot delay the selected connection, and cleanup
  tasks cannot outlive the event loop. Rejected connections are aborted without
  waiting for a graceful disconnect; servers may log "unexpected EOF on client
  connection" if the Terminate message is not delivered before the transport
  closes.

* Fix a connection pool deadlock when releasing a connection after a protocol
  abort (#1324)
  (by @pchaseh in 4a83cc2)

* Honor `Connection.close(timeout=...)` while waiting for a pending
  cancellation (#1361)
  (by @gyanu2507 in c06bcb4)

* Prevent stuck cancellation from blocking connection teardown or pool release
  by bounding cancellation with the command or release timeout (#1370)
  (by @elprans in 4cf0220)

* Preserve the server error when the connection closes mid-operation (#1369)
  (by @RitiGrover in 6c8f1a7)

* Fix COPY cleanup when a records generator raises, preserving the original
  exception and avoiding protocol desynchronization and stalled rollback (#1358)
  (by @CodingCossack in fdc6bc8)

* Reparse unnamed statements before cursor binding when the statement cache
  is disabled (#1364)
  (by @elprans in 302ba49)

* Allow cursors in transactions started outside `Connection.transaction()`,
  such as with an explicit `BEGIN` (#1350)
  (by @aryansk in 25aaaf5)

* Remove the query logger when the `query_logger()` block raises (#1373)
  (by @kratos0718 in 6a7fbd3)

* Fix a segfault in `Record.get()` with an invalid number of positional
  arguments (#1333)
  (by @apoorvdarshan in 40a3832)

* Align SSL startup retries with libpq and improve SSL rejection diagnostics
  (#1366). Retry alternative transports only before authentication succeeds.
  Direct TLS now requires `sslmode=require`, `verify-ca`, or `verify-full`,
  or an explicit `SSLContext`.
  (by @elprans in 78752c9)

* Preserve password errors during SSL fallback when the fallback fails with
  a less specific authorization error (#1331)
  (by @Mauricio0129 in 2d97947)

* Handle cleartext password authentication when no password is supplied
  without raising an `AttributeError` (#1351)
  (by @aryansk in 6be5915)

* Set the `postgresql` ALPN protocol on SSL contexts created by asyncpg so
  direct TLS connections work with PostgreSQL 17 and later (#1372).
  User-provided contexts must set this protocol for direct TLS connections.
  (by @DurandA in b21325d)

* Link explicitly against `libm` on non-Windows platforms to fix undefined
  math symbol errors when loading the extensions (#1305)
  (by @veeceey in db8ecc2)

* Fix builds on FreeBSD 15 by linking against `libstdthreads` (#1368)
  (by @elprans in 87bcaf9)

* Replace `pkg_resources` with `packaging` in `setup.py` (#1362)
  (by @elprans in 6695db7)

* Build Linux and macOS ARM64 wheels on native runners and add Windows ARM64
  wheel builds (#1308)
  (by @ddelange in 1e8cc1c)

* Add manual and PR-label-triggered dry runs to the release workflow (#1374)
  (by @elprans in 1bd643e)

* Clarify how `execute()` uses prepared statements and how to confirm an
  `INSERT` in the documentation (#1336)
  (by @pctablet505 in cdf816c)

* Fix typos in comments and docstrings (#1332)
  (by @maxtaran2010 in bc3e246)

v0.31.0

Toggle v0.31.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.31.0

Enable Python 3.14 with experimental subinterpreter/freethreading
support.

Improvements
============

* Add Python 3.14 support, experimental subinterpreter/freethreading support (#1279)
  (by @elprans in 9e42642)

* Avoid performing type introspection on known types (#1243)
  (by @elprans in 5c9986c)

* Make `prepare()` not use named statements by default when cache is disabled (#1245)
  (by @elprans in 5b14653)

* Implement connection service file functionality (#1223)
  (by @AndrewJackson2020 in 1d63bb1)

Fixes
=====

* Fix multi port connection string issue (#1222)
  (by @AndrewJackson2020 in 01c0db7)

* Avoid leaking connections if _can_use_connection fails (#1269)
  (by @yuliy-openai in e94302d)

Other
=====

* Drop support for EOL Python 3.8 (#1281)
  (by @elprans in 6c2c490)

v0.30.0

Toggle v0.30.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.30.0

Support Python 3.13 and PostgreSQL 17.

Improvements
============

* Implement GSSAPI authentication
  (by @eltoder in 1d4e568 for #1122)

* Implement SSPI authentication
  (by @eltoder in 1aab209 for #1128)

* Add initial typings
  (by @bryanforbes in d42432b for #1127)

* Allow building with Cython 3
  (by @musicinmybrain in 258d8a9 for #1101)

* docs: fix connection pool close call (#1125)
  (by @paulovitorweb in e848814 for #1125)

* Add support for the `sslnegotiation` parameter
  (by @elprans in afdb05c for #1187)

* Test and build on Python 3.13
  (by @elprans in 3aa9894 for #1188)

* Support PostgreSQL 17
  (by @elprans in cee97e1 for #1189)
  (by @MeggyCal in aa2d0e6 for #1185)

* Add `fetchmany` to execute many *and* return rows
  (by @rossmacarthur in 73f2209 for #1175)

* Add `connect` kwarg to Pool to better support GCP's CloudSQL
  (by @d1manson in 3ee19ba for #1170)

* Allow customizing connection state reset (#1191)
  (by @elprans in f6ec755 for #1191)

Fixes
=====

* s/quote/quote_plus/ in the note about DSN part quoting
  (by @elprans in 1194a8a for #1151)

* Use asyncio.run() instead of run_until_complete()
  (by @eltoder in 9fcddfc for #1140)

* Require async_timeout for python < 3.11 (#1177)
  (by @Pliner in 327f2a7 for #1177)

* Allow testing with uvloop on Python 3.12 (#1182)
  (by @musicinmybrain in 597fe54 for #1182)

* Mark pool-wrapped connection coroutine methods as coroutines
  (by @elprans in 636420b for #1134)

* handle `None` parameters in `copy_from_query`, returning `NULL`
  (by @fobispotc in 259d16e for #1180)

* fix: return the pool from _async_init__ if it's already initialized (#1104)
  (by @guacs in 7dc5872 for #1104)

* Replace obsolete, unsafe `Py_TRASHCAN_SAFE_BEGIN/END` (#1150)
  (by @musicinmybrain in 11101c6 for #1150)

v0.29.0

Toggle v0.29.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.29.0

Minor fixes and improvements.

Improvements
============

* Python 3.12 and PostgreSQL 16 support (#1084)
  (by @elprans in deea86c)

* Add support for tuple-format custom codecs on composite types (#1061)
  (by @elprans in 922fcd1)

* Support `target_session_attrs` in URL format, add tests (#1073)
  (by @elprans in 7cb4e70)

* Infinity numeric support (#1067)
  (by @krokoziabla in 0c3bf60 for #1020)

* Add support for the `WHERE` clause in `copy_to` methods (#941)
  (by @kaylynn234 in b7ffab6)

* Add query logging callbacks and context manager (#1043)
  (by @dcwatson in b2697ff)

Fixes
=====

* When prepared statements are disabled, avoid relying on them harder (#1065)
  (by @elprans in cbf64e1)

* Handle environments with HOME set to a not-a-directory (#1063)
  (by @elprans in af922bc)

* Fix handling of non-ASCII passwords (#1062)
  (by @elprans in 89d5bd0)

* Disable JIT while doing type introspection (#1082)
  (by @elprans in f21ebf6)

* Remove connection parameter caching in `Pool` (#1053)
  (by @ermakov-oleg in 4ddb039)

* Switch to Python 3.12-style `wait_for` (#1086)
  (by @elprans in 4bdd8a7)

* Update automatic PostGIS type conversion for Shapely 2.0 (#1085)
  (by @ChimneySwift in 8b45beb)

* Use the `timeout` context manager in the connection path (#1087)
  (by @elprans in 313b2b2)

* Small fix for documentation on using SSL in Connection (#995)
  (by @ScottFred in ccc7baf)

* Use cleanup_ctx in pool usage doc (#878)
  (by @ir4y in 70c8bd8)

* Close cursor portals once the iterator is exhausted (#1088)
  (by @elprans in ca9f03b)

* Cut BaseProtocol circular reference on close. (#1049)
  (by @pteromys in 93a6f79)

* Allow passing hosts as tuples to `connect()` (in addition to lists) (#1021)
  (by @lezram in d7faaff)

Other
=====

* Drop support for Python 3.7 (#1064)
  (by @bryanforbes in 87ab143)

v0.28.0

Toggle v0.28.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.28.0

Minor fixes and improvements.

Changes
=======

* Do not try to cleanup statements (#981)
  (by @fvannee in d2e710f for #981)

* Add Pool.is_closing() method (#973)
  (by @singingwolfboy in 9cb2c1c for #973)

* Fix test_tls_version for LibreSSL (#974)
  (by @CyberTailor in 7df9812 for #974)

* Handle environments without home dir (#1011)
  (by @LeonardBesson in 172b8f6 for #1011)

* fix: salt and iterations parsing for scram (#1026)
  (by @trigonometr in 7443a9e for #1026)

* Add support for target_session_attrs (#987)
  (by @JesseDeLoore in bf74e88 for #987)

* Add support for READ UNCOMMITTED (#1039)
  (by @benwah in 2f20bae for #1039)

* Update benchmarks, add psycopg3 (#1042)
  (by @elprans in 7d4fcf0 for #1042)

v0.27.0

Toggle v0.27.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.27.0

Support Python 3.11 and PostgreSQL 15.  This release also drops support
for Python 3.6.

Changes
=======

* Add arm64 mac and linux wheels
  (by @ddelange in 7bd6c49 for #954)

* Add Python 3.11 to the test matrix
  (by @elprans in 5f908e6 for #948)

* Exclude .venv from flake8 (#958)
  (by @jparise in 40b16ea for #958)

* Upgrade to flake8 5.0.4 (from 3.9.2) (#961)
  (by @jparise in 0e73fec for #961)

* Show an example of a custom Record class (#960)
  (by @jparise in 84c99bf for #960)

* Use the exact type name in Record.__repr__ (#959)
  (by @jparise in eccdf61 for #959)

* Drop Python 3.6 support (#940)
  (by @bryanforbes in bb0cb39 for #940)

* Test on Python 3.11 and PostgreSQL 15, fix workflow deprecations (#968)
  (by @elprans in eab7fdf for #968)

v0.26.0

Toggle v0.26.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.26.0

Changes
-------

* Add support to use awaitable object in password function.   (#889)
  (by @kwarunek in fb3b6bf for #889)

* Support direct TLS connections (i.e. no STARTTLS) (#923)
  (by @jackwotherspoon in f2a937d for #923)

Fixes
-----

* Fix invalid `pyproject.toml` (#900)
  (by @Rongronggg9 in eddb649 for #900)

* Add `record_class` parameter Pool.fetch and Pool.fetchrow (#896)
  (by @baltitenger in 2519cf3 for #896)

* Domain basetypes are introspected (#886) (#887)
  (by @QuantumTM in cca4a2d for #886)

* Properly handle exceptions raised while handling server auth messages (#862)
  (by @elprans in bd19262 for #862)

v0.25.0

Toggle v0.25.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.25.0

Changes
-------

* Improve SSL option compatibility in URIs
  (by @fantix in 383c711 for #827)

* Add `Pool` methods to determine its min, max, current and idle size
  (by @elprans in 603e386 for #849)

* Make it possible to specify a statement name in `Connection.prepare()`
  (by @elprans in 03a3d18 for #846)

* Implement support for `multirange` types
  (by @elprans in d64a44a for #851)

Fixes
-----

* Make sure timeout callbacks always get cleaned up
  (by @elprans in dad2691 for #831)

* Update `__all__` statements to a simpler form that is better supported by typecheckers
  (by @bschnurr in 0a3ae7f for #828)

* Fix `test_timetz_encoding` on Python 3.10
  (by @elprans in 3a90fef)

* Fix a bunch of `ResourceWarnings` in the test suite
  (by @elprans in 2f4fe53)

* Fix `SSLContext` deprecation warnings
  (by @elprans in 4d39a05)

* Fix the description of the database argument to `connect()`
  (by @elprans in a2a9237 for #847)

* Fix parsing of IPv6 addresses in the connection URI
  (by @elprans in f900b73 for #845)

* Improve diagnostics of invalid `executemany()` input
  (by @elprans in a8fc21e for #848)

v0.24.0

Toggle v0.24.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.24.0

Changes
-------

* Drop support for Python 3.5 (#777)
  (by @and-semakin in da58cd2 for #777)

* Add support for Python 3.10 (#795)
  (by @elprans in abf5569 for #795)

* Add support for asynchronous iterables to `copy_records_to_table()` (#713)
  (by @elprans in 1d33ff6 for #713)

* Add support for coroutine functions as listener callbacks (#802)
  (by @elprans in 41da093 for #802)

* Add support for sslcert, sslkey and sslrootcert parameters to DSN (#768)
  (by @jdobes and @elprans in c674e86 for #768)

* Add copy_ wrappers to Pool (#661)
  (by @elprans in a6b0f28 for #661)

* Add issubset and issuperset methods to the Range type (#563)
  (by @kdorsel in de07d0a for #563)

Fixes
-----

* Break connection internal circular reference (#774)
  (by @fantix in d08a9b8 for #774)

* Make Server Version Extraction More Flexible (#778)
  (by @Natrinicle in d076169 for #778)

v0.23.0

Toggle v0.23.0's commit message

Verified

This tag was signed with the committer’s verified signature.
edgedb-ci EdgeDB CI and Release Bot
asyncpg v0.23.0

Fixes
-----

* Avoid TypeError in `Transaction.__repr__` (#703)
  (by @BeatButton in d6eea8e for #703)

* Feed memoryview to `writelines()` (#715)
  (by @fantix in 359a34c for #715)

* Add sslmode=allow support and fix =prefer retry (#720)
  (by @fantix in 075114c for #720)

* Loosen message test in `test_invalid_input` (#751)
  (by @musicinmybrain in bc4127f for #751)

* Support readonly and deferrable for non-serializable transactions (#747)
  (by @pauldraper in 5cf4089 for #747)

* Fix asyncpg with `Py_DEBUG` mode (#719)
  (by @shadchin in a113d90 for #719)

* Fix docs/Makefile and docs/_static/theme_overrides.css missing from PyPI package (#708)
  (by @musicinmybrain in c306068 for #708)
⌂ Proxy