mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-16 11:41:25 +01:00
fix(MySQL): incorrect representation of the DATE if the year is prior to 1900, fixes #860
This commit is contained in:
parent
2ae016f0b6
commit
7969294a93
@ -232,12 +232,13 @@ export class MySQLClient extends BaseClient {
|
||||
const dbConfig = await this.getDbConfig();
|
||||
const connection = await mysql.createConnection({
|
||||
...dbConfig,
|
||||
typeCast: (field, next) => {
|
||||
if (field.type === 'DATETIME')
|
||||
return field.string();
|
||||
else
|
||||
return next();
|
||||
}
|
||||
dateStrings: true
|
||||
// typeCast: (field, next) => {
|
||||
// if (field.type === 'DATETIME')
|
||||
// return field.string();
|
||||
// else
|
||||
// return next();
|
||||
// }
|
||||
});
|
||||
|
||||
return connection;
|
||||
@ -249,12 +250,13 @@ export class MySQLClient extends BaseClient {
|
||||
...dbConfig,
|
||||
connectionLimit: this._poolSize,
|
||||
enableKeepAlive: true,
|
||||
typeCast: (field, next) => {
|
||||
if (field.type === 'DATETIME')
|
||||
return field.string();
|
||||
else
|
||||
return next();
|
||||
}
|
||||
dateStrings: true
|
||||
// typeCast: (field, next) => {
|
||||
// if (field.type === 'DATETIME')
|
||||
// return field.string();
|
||||
// else
|
||||
// return next();
|
||||
// }
|
||||
});
|
||||
|
||||
this._keepaliveTimer = setInterval(async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user