diff --git a/packages/client-common/__tests__/unit/to_search_params.test.ts b/packages/client-common/__tests__/unit/to_search_params.test.ts index f5076701..64edd7dd 100644 --- a/packages/client-common/__tests__/unit/to_search_params.test.ts +++ b/packages/client-common/__tests__/unit/to_search_params.test.ts @@ -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', @@ -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'], diff --git a/packages/client-common/src/settings.ts b/packages/client-common/src/settings.ts index d56c0f84..18266b6f 100644 --- a/packages/client-common/src/settings.ts +++ b/packages/client-common/src/settings.ts @@ -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.