Skip to content

Commit

Permalink
Update MysqlDb.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Apr 5, 2023
1 parent 864f96c commit 96c0169
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/sql/MysqlDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ export class MysqlDb extends Db {
super();
}
async connect(options){

this.name = options.db;
delete options.db;

const client = new Client();
this.connection = await client.connect(options);
this.name = options.db;

await this.connection.query("CREATE DATABASE IF NOT EXISTS `"+this.name+"` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); // Encryption = 'Y'?
await this.connection.execute("CREATE DATABASE IF NOT EXISTS `"+this.name+"` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); // Encryption = 'Y'?
await this.connection.execute(`USE \`${this.name}\``);
}
close(){
Expand Down

0 comments on commit 96c0169

Please sign in to comment.