-
Notifications
You must be signed in to change notification settings - Fork 353
feat: allow applying session settings to queries #1609
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?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f4824e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Security ReviewCritical Issues:
High Priority:
Medium Priority:
Recommendation: Block merge until SQL injection is fixed. This allows arbitrary SQL execution through source settings. |
E2E Test Results✅ All tests passed • 60 passed • 4 skipped • 759s
Tests ran across 4 shards in parallel. |
5c835d4 to
9e170de
Compare
9e170de to
d5bee5f
Compare
d5bee5f to
1ae4d1d
Compare
1ae4d1d to
e3b5142
Compare
| }; | ||
|
|
||
| const querySettings: QuerySettings = [ | ||
| { setting: 'optimize_read_in_order', value: '0' }, |
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.
We may want to limit some of the supported settings in the UI.. or have exclusions.
For example, max_execution_time does not work because we add it in the request headers from the Query Timeout (seconds) option
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.
It looks like the settings configured at the source level and applied per query take precedence over those passed directly to the CH client. Maybe that could be useful if a user wanted to overwrite?
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.
Hmm - definitely worth raising as a question to the team - not sure this should be an override or if global settings should have higher priority.
e3b5142 to
76b91f6
Compare
76b91f6 to
f4824e9
Compare



Closes HDX-3154
This PR adds a feature that allows the user to add settings to a source. These settings are then added to the end of every query that is rendered through the
renderChartConfigfunction, along with any other chart specific settings.See: https://clickhouse.com/docs/sql-reference/statements/select#settings-in-select-query
Most of the work was to pass the
sourceorsource.querySettingsvalue through the code to therenderChartConfigcalls and to update the related tests. There are also some UI changes in theSourceFormcomponents.SQLParser.Parserfrom thenode-sql-parserthrows an error when it encounters a SETTINGS clause in a sql string, so a function was added to remove that clause from any sql that is passed to the parser. It assumes that the SETTINGS clause will always be at the end of the sql string, it removes any part of the string including and after the SETTINGS clause.Screen.Recording.2026-01-16.at.12.42.35.mov