hyperdx/packages/api
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
..
docs/auto_provision feat: Set up default sources/connections with env var in server mode (#817) 2025-05-16 23:17:37 +00:00
migrations chore: Update to next 16, react 19, add react compiler (#1434) 2025-12-04 23:40:59 +00:00
scripts chore: Add automatic api doc generation (#1397) 2025-11-21 21:14:02 +00:00
src feat: allow applying session settings to queries (#1609) 2026-01-21 16:07:30 +00:00
.Dockerignore first commit 2023-09-12 20:08:05 -07:00
.env.development chore: split json otel collector to enable both during dev (#1247) 2025-11-04 21:16:41 +00:00
.env.e2e chore: disable usage stats for e2e tests (#1571) 2026-01-07 22:02:06 +00:00
.env.test Clean Up Integration Test Console Output (#1566) 2026-01-07 17:38:01 +00:00
CHANGELOG.md Release HyperDX (#1542) 2026-01-10 22:19:00 +01:00
Dockerfile revert: api esbuild (#1280) 2025-10-21 09:27:47 +00: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 ci: port v1 metric tests - Pt1 (#638) 2025-02-27 08:07:47 +00:00
jest.setup.ts Clean Up Integration Test Console Output (#1566) 2026-01-07 17:38:01 +00:00
migrate-mongo-config.ts feat: setup clickhouse migration tool + update metrics schema (add is_delta + is_monotonic fields) (#138) 2023-12-03 14:06:50 -08:00
nodemon.json Improve common-utils build performance and add support for .env.local (#1466) 2025-12-11 23:07:16 +00:00
openapi.json chore: Format OpenAPI Docs (#1555) 2026-01-05 17:41:15 +00:00
package.json Release HyperDX (#1542) 2026-01-10 22:19:00 +01:00
tsconfig.build.json fix: Update tsconfigs to resolve IDE type errors (#1150) 2025-09-11 08:55:14 -04:00
tsconfig.json Clean Up Integration Test Console Output (#1566) 2026-01-07 17:38:01 +00:00