-
Notifications
You must be signed in to change notification settings - Fork 416
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
Implement connection service file functionality #1223
base: master
Are you sure you want to change the base?
Implement connection service file functionality #1223
Conversation
Co-authored-by: Elvis Pranskevichus <[email protected]>
Another complication wrt the connection service functionality: apparently connection service files also allow ldap lookups. |
Co-authored-by: Elvis Pranskevichus <[email protected]>
I believe the test failure is due to a flaky test. Please let me know if there are any other changes that need to be made to this PR. |
if ssl is None: | ||
ssl = val | ||
|
||
if 'sslcert' in service_params: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and other ssl params below are missing the if <param> is None:
check.
@@ -2074,6 +2074,7 @@ async def _do_execute( | |||
async def connect(dsn=None, *, | |||
host=None, port=None, | |||
user=None, password=None, passfile=None, | |||
service=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think we should also let you specify the service file location via the servicefile
kwarg (a-la passfile
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add a .. versionadded:: 0.31.0
tag in the docstring below mentioning the new kwargs.
This PR attempts to implement connection service file functionality into asyncpg.
Connection service files are a libpq feature that allows details of postgres connection strings to be stored in a file that is referenced via a
service
parameter in the connection string. This makes it very easy to ensure/enforce consistent connection strings across a codebase.https://www.postgresql.org/docs/17/libpq-pgservice.html