Closed kevcodez closed 6 months ago
For "raw" formats, a stream is required as the input. You could create it from an array, similarly to how it is done in this example: https://github.com/ClickHouse/clickhouse-js/blob/main/examples/node/stream_created_from_array_raw.ts#L23-L30. CSV/TabSepated/CustomSeparated all work the same way.
This bit regarding decimals and JSON looks pretty outdated.
Maybe it was an issue a while ago when we started the project and wrote the initial docs, but as of the current CH versions, it's all good. I will update the docs.
So, it works fine with JSONEachRow. I pushed an example: https://github.com/ClickHouse/clickhouse-js/blob/main/examples/insert_decimals.ts
Docs will be updated when this PR is merged: https://github.com/ClickHouse/clickhouse-docs/pull/2207
According to the docs, we're not supposed to use JSON strings but Tab/CSV separated with the following code
However, this results in the error:
If I take it correctly from the docs, it's not possibly to use TabSeparated / CsvSeparated to insert an array of strings?
Am I missing something here?