@clickhouse/client 1.3.0
New features
-
It is now possible to get the entire response headers object from the
query/insert/command/execmethods. Withquery, you can access theResultSet.response_headersproperty; other methods (insert/command/exec) return it as parts of their response objects as well. For example:const rs = await client.query({ query: 'SELECT * FROM system.numbers LIMIT 1', format: 'JSONEachRow', }) console.log(rs.response_headers['content-type'])This will print:
application/x-ndjson; charset=UTF-8. It can be used in a similar way with the other methods.
Improvements
-
Re-exported several constants from the
@clickhouse/client-commonpackage for convenience:SupportedJSONFormatsSupportedRawFormatsStreamableFormatsStreamableJSONFormatsSingleDocumentJSONFormatsRecordsJSONFormats