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

Error handling for tokio_postgres::Connection created manually #189

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

ollyswanson
Copy link
Contributor

Related discussion: #184

I was struggling a little bit to write docs that didn't leak too much of the implementation details, so I chose to keep it minimal. Happy to push fixups.

  • Adds a new method AsyncPgConnection::try_from_client_and_connection that handles the details of driving the underlying tokio_postgres::Connection. Connections constructed using this method will now benefit from the same error handling provided by AsyncPgConnection::establish.

  • Adds a small section about TLS to the AsyncPgConnection documentation.

  • Updates the TLS examples for Postgres to use the new method.

* Adds a new method `AsyncPgConnection::try_from_client_and_connection`
  that handles the details of driving the underlying
  `tokio_postgres::Connection`. Connections constructed using this
  method will now benefit from the same error handling provided by
  `AsyncPgConnection::establish`.

* Adds a small section about TLS to the `AsyncPgConnection`
  documentation.

* Updates the TLS examples for Postgres to use the new method.
Copy link
Owner

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR. This change including the documentation looks good to me 👍

@weiznich weiznich merged commit 5b8262b into weiznich:main Sep 18, 2024
38 checks passed
@ollyswanson ollyswanson deleted the try_from_client_and_conn branch September 19, 2024 07:53
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