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 a hook into the connection initialization phase #44

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

nikita-volkov
Copy link
Owner

Any opinions or wishes for changes on this?

@steve-chavez @robx @domenkozar

@steve-chavez
Copy link

@nikita-volkov What's the motivation for this PR?

@nikita-volkov
Copy link
Owner Author

To provide a way for the user to issue some commands on every established connection prior to it becoming available for execution of statements thru the pool. E.g., to configure connections by issuing a bunch of SET commands.

@steve-chavez
Copy link

Ah nice, it enables session variables then. If the connection dies, will the session variable survive?

@nikita-volkov
Copy link
Owner Author

I'm not sure what you imply by connection dying and variable surviving.

The same session will be reexecuted each time a connection gets established by the pool for whatever reasons. That means that it'll be safe to assume that every connection used by the pool will be running having that session executed.

@nikita-volkov nikita-volkov merged commit b520008 into master Apr 25, 2024
@nikita-volkov nikita-volkov deleted the init-session branch April 25, 2024 06: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