Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connect kwarg to Pool to better support GCP's CloudSQL #1170

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

d1manson
Copy link
Contributor

@d1manson d1manson commented Aug 5, 2024

This relates to an issue I created a few months back and then updated last week.

GCP's cloud-sql-python-connector offers asyncpg as one of its drivers - see logic here - however that can only be used as a single connection, not in conjunction with asyncpg's Pool class because it wraps the connection.connect(..) call in various bits of logic to do with authentication and SSL (which I admit I haven't tried to fully understand).

This PR simply turns the call to connection.connect into a kwarg parameter on the Pool class so it can be overridden.

Usage would be something like this:

from asyncpg import create_pool
from google.cloud.sql.connector import Connector

async def connect(dsn, **kwargs):
    # The dsn should be a cloudsql instance_connection_string, not a full dsn; we use the name 'dsn' for consistency
    # with the original asyncpg.connect function arguments.
    connector = Connector(enable_iam_auth=True) 
    return await connector.connect_async(
        dsn,
        driver="asyncpg",
        user="SOME_USER_HERE",
        **kwargs
    )

async def main():
    pool = create_pool(..., connect=connect)   # UPDATED: in an earlier version of this pr, this read connect_fn=connect
    ... 

Note the gcp repo's docs suggest using SQLAlchemy for a pool, but that's not much use if your codebase already uses asyncpg's Pool API (at least as far as I understand from SQLAlchemy).

--

Couple of additional thoughts:

  1. It is perhaps a bit confusing that there will now be three functions that all see somewhat similar in name - init, setup and a connect_fn, but I don't know enough to say if they can be refactored into fewer kwargs somehow.

  2. As noted in my issue, linked above, it is possible to work around this by subclassing the Pool class, but that's not especially nice and this seemed like a small ask so thought it was worth suggesting.

@d1manson d1manson changed the title Add connect_fn kwarg to pool to better support GCP's CloudSQL Add connect_fn kwarg to Pool to better support GCP's CloudSQL Aug 5, 2024
Copy link
Member

@elprans elprans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I made some tweaks, mainly renamed connect_fn to connect for consistency with other Pool callbacks.

@elprans elprans merged commit 3ee19ba into MagicStack:master Oct 18, 2024
41 checks passed
elprans added a commit that referenced this pull request Oct 18, 2024
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)
@elprans elprans mentioned this pull request Oct 18, 2024
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 18, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
elprans added a commit that referenced this pull request Oct 19, 2024
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)
@elprans elprans mentioned this pull request Oct 19, 2024
elprans added a commit that referenced this pull request Oct 19, 2024
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)
@elprans elprans mentioned this pull request Oct 19, 2024
@d1manson d1manson changed the title Add connect_fn kwarg to Pool to better support GCP's CloudSQL Add connect kwarg to Pool to better support GCP's CloudSQL Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants