-
Notifications
You must be signed in to change notification settings - Fork 0
feat(connection): add option to set session variables #7
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
Conversation
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.
Pull Request Overview
This PR adds support for setting MySQL session variables when establishing a connection. The feature allows users to configure session-level variables (like sql_mode, autocommit, etc.) through connection configuration, with a default setting for vector_type_project_format.
Key changes:
- Added
sessionVariablesoption toConnectionOptionsinterface - Implemented session variable setting logic in connection establishment
- Added test coverage for the new functionality
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| typings/mysql/lib/Connection.d.ts | Added sessionVariables option to TypeScript type definitions |
| lib/connection_config.js | Added configuration handling for session variables with defaults |
| lib/base/connection.js | Implemented session variable setting via SET query during connection |
| test/integration/connection/test-connect-with-session-vars.test.cjs | New test validating session variables are correctly set |
| test/integration/connection/test-disconnects.test.cjs | Added sessionVariables: null to disable defaults in test |
| test/integration/connection/test-change-user-multi-factor.test.cjs | Added sessionVariables: null to disable defaults in test |
| test/common.test.cjs | Added sessionVariables to common connection creation helper |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ef28e7f to
4187e42
Compare
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.
Pull request overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
95024ff to
d193513
Compare
sessionVariablesoption. The PR also updates tests to ignore the new option when connecting to the mock server and adds a dedicated integration test for session variable functionality.BaseConnectionconstructor for clarity. (lib/base/connection.js)