-
Notifications
You must be signed in to change notification settings - Fork 629
feat: add Session api for stateful connection and set role support #1597
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
base: main
Are you sure you want to change the base?
feat: add Session api for stateful connection and set role support #1597
Conversation
|
@SpencerTorres need your help with reviews on this one. |
|
Nice! This is pretty much how I'd do it. A few thoughts:
Let me know if you have any thoughts. I appreciate you submitting this and other PRs, these are useful additions! |
|
These are some great feedbacks, IMO if we want to role this out, we can do this Iteratively like below.
lmk your thoughts, and thanks for the feedbacks! |
a66d435 to
4b3d3df
Compare
|
+1 to prioritize the above PR - is there currently some other way to change a role dynamically on a per -query basis (e.g., via |
fixes: #1443
please check the end to end implementation with this toy program https://github.com/shivanshuraj1333/clickhuose-test
make sure to update the go.mod to point to the changes present in this PR
Summary:
Problem: ClickHouse Go driver lacks support for SET ROLE functionality due to connection pooling, which doesn't maintain connection state across multiple statements.
Solution: Added session management API that provides stateful connections while maintaining backward compatibility.
Key Changes
Implementation:
example usage: