diff --git a/lib/db/clickhouse.js b/lib/db/clickhouse.js index 6f3a32a0..f934708f 100644 --- a/lib/db/clickhouse.js +++ b/lib/db/clickhouse.js @@ -1366,6 +1366,9 @@ const rawRequest = async (query, data, database, config) => { if (data && !(Buffer.isBuffer(data) || data instanceof Uint8Array || typeof data === 'string')) { throw new Error('data must be Buffer, Uint8Array or String: currently the data is: ' + typeof data) } + if (typeof data === 'string') { + data = Buffer.from(data, 'utf8') + } if (typeof query !== 'string') { throw new Error('query must be String: currently the query is: ' + typeof query) }