hyperdx/packages/common-utils
Karl Power bc8c4eec9a
feat: allow applying session settings to queries (#1609)
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 `renderChartConfig` function, 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 `source` or `source.querySettings` value through the code to the `renderChartConfig` calls and to update the related tests. There are also some UI changes in the `SourceForm` components.

`SQLParser.Parser` from the `node-sql-parser` throws 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.


https://github.com/user-attachments/assets/7ac3b852-2c86-4431-88bc-106f982343bb
2026-01-21 16:07:30 +00:00
..
src feat: allow applying session settings to queries (#1609) 2026-01-21 16:07:30 +00:00
.env.test perf: Improve getKeyValues query performance for JSON keys (#1284) 2025-10-27 16:46:46 +00:00
CHANGELOG.md Release HyperDX (#1542) 2026-01-10 22:19:00 +01:00
eslint.config.mjs chore(eslint): add @typescript-eslint/no-unsafe-type-assertion rule (#1534) 2025-12-30 16:01:11 +00:00
jest.config.js perf: Improve getKeyValues query performance for JSON keys (#1284) 2025-10-27 16:46:46 +00:00
jest.int.config.js perf: Improve getKeyValues query performance for JSON keys (#1284) 2025-10-27 16:46:46 +00:00
package.json Release HyperDX (#1542) 2026-01-10 22:19:00 +01:00
README.md DX: running api + app + task concurrently with npm script (dev) (#567) 2025-01-23 17:31:25 +00:00
tsconfig.json Improve common-utils intellisense. Currently "Go to Definition" on an… (#1159) 2025-09-11 12:57:41 -06:00
tsup.config.ts feat: introduce common-utils package (#554) 2025-01-16 18:15:22 +00:00

How to test the package with HyperDX app/api

  1. Run yarn build in the root directory of this project (packages/common-utils)
  2. Run yarn dev in the root directory of app/api project (packages/app,api)
  3. You should be able to test utils with the app