mirror of
https://github.com/lingble/clickhouse.git
synced 2025-12-03 03:03:33 +00:00
Merge pull request #1 from Tgarifullin/Tgarifullin-patch-1
boolean and int values problem fix
This commit is contained in:
11
index.js
11
index.js
@@ -475,9 +475,18 @@ class ClickHouse {
|
|||||||
}).join('\t');
|
}).join('\t');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_convertTypes(value) {
|
||||||
|
if (value===true) {
|
||||||
|
return '1'
|
||||||
|
}
|
||||||
|
if (value===false) {
|
||||||
|
return '0'
|
||||||
|
}
|
||||||
|
return value != null ? value : ''
|
||||||
|
}
|
||||||
|
|
||||||
_mapRowAsObject(fieldList, row) {
|
_mapRowAsObject(fieldList, row) {
|
||||||
return fieldList.map(f => encodeValue(false, row[f] || '', 'TabSeparated')).join('\t');
|
return fieldList.map(f => encodeValue(false, this._convertTypes(row[f]), 'TabSeparated')).join('\t');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user