Skip to content
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

Add session_timeout and session_check settings typings #372

Merged
merged 4 commits into from
Jan 9, 2025
Merged
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
18 changes: 18 additions & 0 deletions packages/client-common/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1581,9 +1581,27 @@ interface ClickHouseServerSettings {
zstd_window_log_max?: Int64
}

/** @see https://clickhouse.com/docs/en/interfaces/http */
interface ClickHouseHTTPSettings {
/** 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.
* Additionally, this is useful when executing DDLs on clustered environments,
* as the client will receive the response only when the DDL is applied on all nodes of the cluster. */
wait_end_of_query: Bool
/** Format to use if a SELECT query is executed without a FORMAT clause.
* Only useful for the {@link ClickHouseClient.exec} method,
* as {@link ClickHouseClient.query} method always attaches this clause. */
default_format: DataFormat
/** By default, the session is terminated after 60 seconds of inactivity
* This is regulated by the `default_session_timeout` server setting. */
session_timeout: UInt64
/** You can use this setting to check the session status before executing the query.
* If a session is expired or cannot be found, the server returns `SESSION_NOT_FOUND` with error code 372.
* NB: the session mechanism is only reliable when you connect directly to a particular ClickHouse server node.
* Due to each particular session not being shared across the cluster, sessions won't work well in a multi-node environment with a load balancer,
* as there will be no guarantee that each consequent request will be received on the same node. */
session_check: Bool
}

export type ClickHouseSettings = Partial<ClickHouseServerSettings> &
Expand Down
Loading