Open phuc49 opened 8 months ago
Maybe try inserting it as a 'NULL' string? Here's a simplified approach on how I did it in my app:
const dto = (
psid: string,
// ....
): Array<string | number> => {
return [
psid,
....
]
// call it like
dto(params.psid)
// or
dto('NULL')
}
then you can save it like:
const query = `INSERT INTO table (*) VALUES ${_join(data, ',')}`
try {
await clickhouse.query(query).toPromise()
} catch (e) {
console.error(`[CRON WORKER] Error whilst saving log data: ${e}`)
}
and eventually it should store the data as null
:
if value = null why dont insert that null value to db