Upgrading asyncpg 0.10 to 0.11
Breaking0.10.1 → 0.11.0Breaking3New2Fixed5Other1
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- Server settings must now be passed in a dedicated server_settings argument instead of as loose keyword arguments.
- When calling executemany(), the timeout must now be passed by name rather than by position.
- Query text arguments must now be strings; other types are rejected.
Must act 3 items need code or config changes
What you must change
Breaking3
connect() and create_pool() no longer accept arbitrary keyword arguments for server settings; use server_settings.connect()create_pool()server_settingsMakes the
timeout parameter of executemany() a keyword-only argument.executemany()timeoutProhibits passing non-string instances as text arguments to queries.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export Connection
- added:
function fspath(path) - added:
variable PY_36 - added:
variable fspath
- changed:
async function connect(dsn=…, *, host=…, port=…, user=…, password=…, database=…, loop=…, timeout=…, statement_cache_size=…, max_cached_statement_lifetime=…, max_cacheable_statement_size=…, command_timeout=…, ssl=…, __connection_class__=…, **opts) → async function connect(dsn=…, *, host=…, port=…, user=…, password=…, database=…, loop=…, timeout=…, statement_cache_size=…, max_cached_statement_lifetime=…, max_cacheable_statement_size=…, command_timeout=…, ssl=…, connection_class=…, server_settings=…) - changed:
async method Connection.executemany(command: str, args, _timeout: float=…, **kw) → async method Connection.executemany(command: str, args, *, timeout: float=…) - changed:
constructor Connection(protocol, transport, loop, addr, opts, *, statement_cache_size, command_timeout, max_cached_statement_lifetime, max_cacheable_statement_size, ssl_context) → constructor Connection(protocol, transport, loop, addr: (str, int) or str, config: connect_utils._ClientConfiguration, params: connect_utils._ConnectionParameters) - added:
async method Connection.copy_from_query(query, *args, output, timeout=…, format=…, oids=…, delimiter=…, null=…, header=…, quote=…, escape=…, force_quote=…, encoding=…) - added:
async method Connection.copy_from_table(table_name, *, output, columns=…, schema_name=…, timeout=…, format=…, oids=…, delimiter=…, null=…, header=…, quote=…, escape=…, force_quote=…, encoding=…) - added:
async method Connection.copy_records_to_table(table_name, *, records, columns=…, schema_name=…, timeout=…) - added:
async method Connection.copy_to_table(table_name, *, source, columns=…, schema_name=…, timeout=…, format=…, oids=…, freeze=…, delimiter=…, null=…, header=…, quote=…, escape=…, force_quote=…, force_not_null=…, force_null=…, encoding=…)
- changed:
constructor Pool(*connect_args, min_size, max_size, max_queries, max_inactive_connection_lifetime, setup, init, loop, **connect_kwargs) → constructor Pool(*connect_args, min_size, max_size, max_queries, max_inactive_connection_lifetime, setup, init, loop, connection_class, **connect_kwargs) - changed:
function create_pool(dsn=…, *, min_size=…, max_size=…, max_queries=…, max_inactive_connection_lifetime=…, setup=…, init=…, loop=…, **connect_kwargs) → function create_pool(dsn=…, *, min_size=…, max_size=…, max_queries=…, max_inactive_connection_lifetime=…, setup=…, init=…, loop=…, connection_class=…, **connect_kwargs)