Upgrading asyncpg 0.30 to 0.31
Breaking0.30.0 → 0.31.0Platform2New1Changed2Fixed2
BreakingUpgrade verdict
2 platform requirement changes.
In plain terms
- The library now works on Python 3.14, including early support for running it in subinterpreters and without the global interpreter lock.
- Python 3.8 is no longer supported; users must upgrade to a newer Python version.
Must act 2 items need code or config changes
Python requirement changed in 0.31.0: >=3.8.0 → >=3.9.0.
What you must change
Platform2
Adds Python 3.14 support with experimental subinterpreter and freethreading support.
Drops support for end-of-life Python 3.8.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
constructor TLSUpgradeProto(loop, host, port, ssl_context, ssl_is_advisory) → constructor TLSUpgradeProto(loop: asyncio.AbstractEventLoop, host: str, port: int, ssl_context: ssl_module.SSLContext, ssl_is_advisory: bool) -> None - changed:
method TLSUpgradeProto.connection_lost(exc) → method TLSUpgradeProto.connection_lost(exc: typing.Optional[Exception]) -> None - changed:
method TLSUpgradeProto.data_received(data) → method TLSUpgradeProto.data_received(data: bytes) -> None - added:
variable PG_SERVICEFILE
- changed:
async function connect(dsn=…, *, host=…, port=…, user=…, password=…, passfile=…, database=…, loop=…, timeout=…, statement_cache_size=…, max_cached_statement_lifetime=…, max_cacheable_statement_size=…, command_timeout=…, ssl=…, direct_tls=…, connection_class=…, record_class=…, server_settings=…, target_session_attrs=…, krbsrvname=…, gsslib=…) → async function connect(dsn=…, *, host=…, port=…, user=…, password=…, passfile=…, service=…, servicefile=…, database=…, loop=…, timeout=…, statement_cache_size=…, max_cached_statement_lifetime=…, max_cacheable_statement_size=…, command_timeout=…, ssl=…, direct_tls=…, connection_class=…, record_class=…, server_settings=…, target_session_attrs=…, krbsrvname=…, gsslib=…) - changed:
async method Connection.execute(query: str, *args, timeout: float=…) -> str → async method Connection.execute(query: str, *args, timeout: typing.Optional[float]=…) -> str - changed:
async method Connection.executemany(command: str, args, *, timeout: float=…) → async method Connection.executemany(command: str, args, *, timeout: typing.Optional[float]=…) - changed:
async method Connection.fetchmany(query, args, *, timeout: float=…, record_class=…) → async method Connection.fetchmany(query, args, *, timeout: typing.Optional[float]=…, record_class=…)
- removed:
variable TYPE_BY_OID - added:
function TypeRecord(rec: typing.Tuple[int, typing.Optional[int], bytes]) -> protocol.Record
- added:
method CodecContext.get_json_decoder() -> object - added:
method CodecContext.get_json_encoder() -> object
- changed:
constructor BitString(bitstring: typing.Optional[builtins.bytes]=…) -> None → constructor BitString(bitstring: builtins.bytes | None=…) -> None - changed:
static method BitString.from_int(x: int, length: int, bitorder: _BitOrderType=…, *, signed: bool=…) -> _BitString → static method BitString.from_int(x: int, length: int, bitorder: _BitOrderType=…, *, signed: bool=…) -> Self - changed:
static method BitString.frombytes(bytes_: typing.Optional[builtins.bytes]=…, bitlength: typing.Optional[int]=…) -> _BitString → static method BitString.frombytes(bytes_: builtins.bytes | None=…, bitlength: int | None=…) -> Self
- changed:
async method Pool.execute(query: str, *args, timeout: float=…) -> str → async method Pool.execute(query: str, *args, timeout: Optional[float]=…) -> str - changed:
async method Pool.executemany(command: str, args, *, timeout: float=…) → async method Pool.executemany(command: str, args, *, timeout: Optional[float]=…) - changed:
async method PoolConnectionHolder.close() → async method PoolConnectionHolder.close() -> None - changed:
async method PoolConnectionHolder.connect() → async method PoolConnectionHolder.connect() -> None - changed:
async method PoolConnectionHolder.release(timeout) → async method PoolConnectionHolder.release(timeout: Optional[float]) -> None - changed:
async method PoolConnectionHolder.wait_until_released() → async method PoolConnectionHolder.wait_until_released() -> None - changed:
constructor PoolAcquireContext(pool, timeout) → constructor PoolAcquireContext(pool: Pool, timeout: Optional[float]) -> None - changed:
constructor PoolConnectionHolder(pool, *, max_queries, setup, max_inactive_time) → constructor PoolConnectionHolder(pool: Pool, *, max_queries: float, setup: Optional[Callable[[PoolConnectionProxy], Awaitable[None]]], max_inactive_time: float) -> None - changed:
constructor PoolConnectionProxy(holder: PoolConnectionHolder, con: connection.Connection) → constructor PoolConnectionProxy(holder: PoolConnectionHolder, con: connection.Connection) -> None - changed:
method PoolConnectionHolder.is_connected() → method PoolConnectionHolder.is_connected() -> bool - changed:
method PoolConnectionHolder.is_idle() → method PoolConnectionHolder.is_idle() -> bool - changed:
method PoolConnectionHolder.terminate() → method PoolConnectionHolder.terminate() -> None
- changed:
async method PreparedStatement.executemany(args, *, timeout: float=…) → async method PreparedStatement.executemany(args, *, timeout: typing.Optional[float]=…)
- removed:
class Record - removed:
method Record.get(key: str) -> Any | None | (key: str, default: _T) -> Any | _T - removed:
method Record.items() -> Iterator[tuple[str, Any]] - removed:
method Record.keys() -> Iterator[str] - removed:
method Record.values() -> Iterator[Any]
- added:
class Record - added:
method Record.get(key: str) -> Any | None | (key: str, default: _T) -> Any | _T - added:
method Record.items() -> Iterator[tuple[str, Any]] - added:
method Record.keys() -> Iterator[str] - added:
method Record.values() -> Iterator[Any]