From 5a882304a56691c8946d571fdf03fb98cea4cc3b Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 15 Aug 2023 22:31:41 +0300 Subject: [PATCH] Small fixes --- src/MariaDB.ts | 2 ++ src/MongoDB.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MariaDB.ts b/src/MariaDB.ts index b3c286d..c4a275f 100644 --- a/src/MariaDB.ts +++ b/src/MariaDB.ts @@ -416,6 +416,8 @@ class MariaDB if (!this.ready) return Promise.reject(new Error('MariaDB not ready')); + query = query.trim(); + let batch = false; if (values && typeof values.some === 'function') batch = values.some(val => val instanceof Array); diff --git a/src/MongoDB.ts b/src/MongoDB.ts index 7d2089a..aa4aff0 100644 --- a/src/MongoDB.ts +++ b/src/MongoDB.ts @@ -50,6 +50,7 @@ class MongoDB #config: MongoOptions; #logger: ILogger; #URI: string; + #load: boolean; #db: Db | null; #_client: MongoClient; @@ -69,6 +70,7 @@ class MongoDB this.#config = config; this.#db = null; // DB connection this.#_database = database; // Which database to connect to + this.#load = config.load ?? true; this.#logger = server.createLogger(this, config.loggerOptions); @@ -121,7 +123,7 @@ class MongoDB async init () { - if (!this.#config.load) + if (!this.#load) return this.#logger.info('Not loading MongoDB'); if (this.#db)