This commit is contained in:
Jan Prochazka
2021-03-27 16:04:12 +01:00
parent 11985004b5
commit bbc50ea3fb
3 changed files with 11 additions and 5 deletions

View File

@@ -46,11 +46,12 @@ export class SqlDumper {
}
putValue(value) {
if (value === null) this.putRaw('NULL');
if (value === true) this.putRaw('1');
if (value === false) this.putRaw('0');
else if (value === true) this.putRaw('1');
else if (value === false) this.putRaw('0');
else if (_isString(value)) this.putStringValue(value);
else if (_isNumber(value)) this.putRaw(value.toString());
else if (_isDate(value)) this.putStringValue(new Date(value).toISOString());
else this.putRaw('NULL');
}
putCmd(format, ...args) {
this.put(format, ...args);