From fc8eb81ffe9abc8f72e024f3170d1cdade6d11f7 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 16 Apr 2023 16:50:01 +0300 Subject: [PATCH] v1.3.0 --- package.json | 2 +- src/MariaDB.ts | 6 +++--- src/MongoDB.ts | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 87e5b93..839b908 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@navy.gif/wrappers", - "version": "1.2.3", + "version": "1.3.0", "description": "Various wrapper classes I use in my projects", "repository": "https://git.corgi.wtf/Navy.gif/wrappers.git", "author": "Navy.gif", diff --git a/src/MariaDB.ts b/src/MariaDB.ts index 9937811..a445f7e 100644 --- a/src/MariaDB.ts +++ b/src/MariaDB.ts @@ -15,9 +15,9 @@ type Credentials = { } export type MariaOptions = { - load: boolean, - cluster: PoolClusterConfig, - client: PoolConfig, + load?: boolean, + cluster?: PoolClusterConfig, + client?: PoolConfig, credentials: Credentials, loggerOptions?: LoggerClientOptions } diff --git a/src/MongoDB.ts b/src/MongoDB.ts index c027700..9924f19 100644 --- a/src/MongoDB.ts +++ b/src/MongoDB.ts @@ -14,8 +14,9 @@ type Credentials = { export type MongoOptions = { credentials: Credentials, - loggerOptions: LoggerClientOptions, - client: MongoClientOptions + loggerOptions?: LoggerClientOptions, + client: MongoClientOptions, + load?: boolean } /** @@ -90,6 +91,9 @@ class MongoDB { */ async init () { + if (this.#config.load) + return this.#logger.info('Not loading MongoDB'); + this.#logger.status(`Initializing database connection to ${this.#_client.options.hosts}`); await this.#_client.connect();