1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix(MySQL): invalid JavaScript datetime values not shown

This commit is contained in:
2021-04-16 18:48:56 +02:00
parent 7d2ace9456
commit dcccb544f9

View File

@@ -104,8 +104,18 @@ export class MySQLClient extends AntaresCore {
async connect () { async connect () {
if (!this._poolSize) if (!this._poolSize)
this._connection = mysql.createConnection(this._params); this._connection = mysql.createConnection(this._params);
else else {
this._connection = mysql.createPool({ ...this._params, connectionLimit: this._poolSize }); this._connection = mysql.createPool({
...this._params,
connectionLimit: this._poolSize,
typeCast: (field, next) => {
if (field.type === 'DATETIME')
return field.string();
else
return next();
}
});
}
} }
/** /**