@clickhouse/client
Advanced tools
Changelog
0.1.1
ClickHouseClientConfigOptions.keep_alive
for more details. Disabled by default.TRACE
log level.const client = createClient({
keep_alive: {
enabled: false,
},
})
const client = createClient({
keep_alive: {
enabled: true,
// should be slightly less than the `keep_alive_timeout` setting in server's `config.xml`
// default is 3s there, so 2500 milliseconds seems to be a safe client value in this scenario
// another example: if your configuration has `keep_alive_timeout` set to 60s, you could put 59_000 here
socket_ttl: 2500,
retry_on_expired_socket: true,
},
})
Changelog
0.1.0
connect_timeout
client setting is removed, as it was unused in the code.command
method is introduced as an alternative to exec
.
command
does not expect user to consume the response stream, and it is destroyed immediately.
Essentially, this is a shortcut to exec
that destroys the stream under the hood.
Consider using command
instead of exec
for DDLs and other custom commands which do not provide any valuable output.Example:
// incorrect: stream is not consumed and not destroyed, request will be timed out eventually
await client.exec('CREATE TABLE foo (id String) ENGINE Memory')
// correct: stream does not contain any information and just destroyed
const { stream } = await client.exec(
'CREATE TABLE foo (id String) ENGINE Memory',
)
stream.destroy()
// correct: same as exec + stream.destroy()
await client.command('CREATE TABLE foo (id String) ENGINE Memory')
Changelog
0.0.16
\N
instead of 'NULL'
string, it is now correctly handled for both null
and explicitly undefined
parameters. See the test scenarios for more details.Changelog
0.0.15
Changelog
0.0.14
JSONStrings
, JSONCompact
, JSONCompactStrings
, JSONColumnsWithMetadata
formats (@andrewzolotukhin).Changelog
0.0.13
query_id
can be now overridden for all main client's methods: query
, exec
, insert
.Changelog
0.0.12
ResultSet.query_id
contains a unique query identifier that might be useful for retrieving query metrics from system.query_log
User-Agent
HTTP header is set according to the language client spec.
For example, for client version 0.0.12 and Node.js runtime v19.0.4 on Linux platform, it will be clickhouse-js/0.0.12 (lv:nodejs/19.0.4; os:linux)
.
If ClickHouseClientConfigOptions.application
is set, it will be prepended to the generated User-Agent
.client.insert
now returns { query_id: string }
instead of void
client.exec
now returns { stream: Stream.Readable, query_id: string }
instead of just Stream.Readable
Changelog
0.0.11, 2022-12-08
log.enabled
flag was removed from the client configuration.CLICKHOUSE_LOG_LEVEL
environment variable instead. Possible values: OFF
, TRACE
, DEBUG
, INFO
, WARN
, ERROR
.
Currently, there are only debug messages, but we will log more in the future.For more details, see PR #110