Fix errors

This commit is contained in:
Chongyi Zheng 2023-09-15 18:01:15 -04:00
parent 6ffa4b707b
commit 6a2e5202e2
No known key found for this signature in database
GPG key ID: E3C2287691E40E35

View file

@ -232,7 +232,7 @@ class Database {
}
};
} else if (dbConfig.type === "mariadb") {
validateDBName(dbConfig.dbName);
this.validateDBName(dbConfig.dbName);
const connection = await mysql.createConnection({
host: dbConfig.hostname,
@ -270,7 +270,7 @@ class Database {
pool: mariadbPoolConfig,
};
} else if (dbConfig.type === "postgres") {
validateDBName(dbConfig.dbName);
this.validateDBName(dbConfig.dbName);
const clientConfig = {
host: dbConfig.hostname,
@ -280,7 +280,7 @@ class Database {
database: dbConfig.dbName,
};
const client = new pg.Client(clientConfig);
await connection.execute("CREATE DATABASE IF NOT EXISTS " + dbConfig.dbName);
await client.execute("CREATE DATABASE IF NOT EXISTS " + dbConfig.dbName);
await client.end();
config = {