mirror of https://github.com/Fabio286/antares.git
fix(MySQL): invalid JavaScript datetime values not shown
This commit is contained in:
parent
7d2ace9456
commit
dcccb544f9
|
@ -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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue