Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ describe('toSearchParams', () => {
extremes: 1,
enable_optimize_predicate_expression: 0,
wait_end_of_query: 1,
compress: 1,
decompress: 1,
quota_key: 'my-quota-key',
buffer_size: 1048576,
},
query_params: {
qaz: 'qux',
Expand All @@ -84,12 +88,16 @@ describe('toSearchParams', () => {
})!
const result = toSortedArray(params)
expect(result).toEqual([
['buffer_size', '1048576'],
['compress', '1'],
['database', 'some_db'],
['decompress', '1'],
['enable_optimize_predicate_expression', '0'],
['extremes', '1'],
['param_qaz', 'qux'],
['query', 'SELECT * FROM system.query_log'],
['query_id', 'my-query-id'],
['quota_key', 'my-quota-key'],
['role', 'my-role-1'],
['role', 'my-role-2'],
['session_id', 'my-session-id'],
Expand Down
13 changes: 13 additions & 0 deletions packages/client-common/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,19 @@ interface ClickHouseServerSettings {

/** @see https://clickhouse.com/docs/en/interfaces/http */
interface ClickHouseHTTPSettings {
/** If you specify compress=1, the server will compress the data it sends to you. */
compress: Bool
/** If you specify decompress=1, the server will decompress the data which you pass in the POST method. */
decompress: Bool
/** The quota_key "key" is passed in the query parameter, and the quota is tracked separately for each key value.
* For example, you can pass a username as the key, so the quota will be counted separately for each username. */
quota_key: string
/** Determines the number of bytes in the result to buffer in the server memory.
* If a result body is larger than this threshold, the buffer is written to the HTTP channel,
* and the remaining data is sent directly to the HTTP channel.
* To ensure that the entire response is buffered, set wait_end_of_query=1.
* In this case, the data that is not stored in memory will be buffered in a temporary server file. */
buffer_size: UInt64
/** Ensures that the entire response is buffered.
* In this case, the data that is not stored in memory will be buffered in a temporary server file.
* This could help prevent errors that might occur during the streaming of SELECT queries.
Expand Down