Skip to content

feat: Implement before_connect callback to modify connect options. #3562

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

Closed
wants to merge 4 commits into from

Conversation

jrasanen
Copy link

Allows the user to see and maybe modify the connect options before each attempt to connect to a database. May be used in a number of ways, e.g.:

  • adding jitter to connection lifetime
  • validating/setting a per-connection password
  • using a custom server discovery process

The original author of this PR stopped responding, so I cherry-picked the work done in this pull request and rebased this against the latest main.

Would be great to see this PR land into the main!

Thanks

@jrasanen
Copy link
Author

AFAIK, this closes #3117

@jrasanen
Copy link
Author

I would not normally mention people in pull-requests, but @abonander reviewed and accepted the previous related PR regarding this.

fiadliel and others added 4 commits October 14, 2024 16:55
Allows the user to see and maybe modify the connect options before
each attempt to connect to a database. May be used in a number of
ways, e.g.:
 - adding jitter to connection lifetime
 - validating/setting a per-connection password
 - using a custom server discovery process
Allows the user to see and maybe modify the connect options before
each attempt to connect to a database. May be used in a number of
ways, e.g.:
 - adding jitter to connection lifetime
 - validating/setting a per-connection password
 - using a custom server discovery process
@abonander
Copy link
Collaborator

I appreciate the effort, but I ended up deciding to go in a different direction. This has been superceded by #3582 and the PoolConnector trait, which is going to be a lot more flexible.

@abonander abonander closed this Oct 29, 2024
@cty123
Copy link

cty123 commented Mar 30, 2025

@abonander Perhaps it makes sense to merge this small PR while you are working on the other one. Also the PR you are working on appears to be non-backward compatible, do you want to release it under a different major version?

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.

4 participants