Small fixes

This commit is contained in:
Erik 2023-08-15 22:31:41 +03:00
parent 3b50f2dad5
commit 5a882304a5
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
2 changed files with 5 additions and 1 deletions

View File

@ -416,6 +416,8 @@ class MariaDB
if (!this.ready) if (!this.ready)
return Promise.reject(new Error('MariaDB not ready')); return Promise.reject(new Error('MariaDB not ready'));
query = query.trim();
let batch = false; let batch = false;
if (values && typeof values.some === 'function') if (values && typeof values.some === 'function')
batch = values.some(val => val instanceof Array); batch = values.some(val => val instanceof Array);

View File

@ -50,6 +50,7 @@ class MongoDB
#config: MongoOptions; #config: MongoOptions;
#logger: ILogger; #logger: ILogger;
#URI: string; #URI: string;
#load: boolean;
#db: Db | null; #db: Db | null;
#_client: MongoClient; #_client: MongoClient;
@ -69,6 +70,7 @@ class MongoDB
this.#config = config; this.#config = config;
this.#db = null; // DB connection this.#db = null; // DB connection
this.#_database = database; // Which database to connect to this.#_database = database; // Which database to connect to
this.#load = config.load ?? true;
this.#logger = server.createLogger(this, config.loggerOptions); this.#logger = server.createLogger(this, config.loggerOptions);
@ -121,7 +123,7 @@ class MongoDB
async init () async init ()
{ {
if (!this.#config.load) if (!this.#load)
return this.#logger.info('Not loading MongoDB'); return this.#logger.info('Not loading MongoDB');
if (this.#db) if (this.#db)