Merge pull request #326 from HHongSeungWoo/master

fix: fix typecasting problem when using old version mysql
This commit is contained in:
kononnable 2021-05-21 10:22:32 +02:00 committed by GitHub
commit 787ad5fdec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,6 +493,17 @@ export default class MysqlDriver extends AbstractDriver {
};
}
config.typeCast = (field, next) => {
switch (field.type) {
case "VAR_STRING":
return field.string();
case "BLOB":
return field.string();
default:
return next();
}
};
const promise = new Promise<boolean>((resolve, reject) => {
this.Connection = this.MYSQL.createConnection(config);