This commit is contained in:
Erik 2023-04-16 16:50:01 +03:00
parent 8f76a3e59b
commit fc8eb81ffe
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68
3 changed files with 10 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@navy.gif/wrappers", "name": "@navy.gif/wrappers",
"version": "1.2.3", "version": "1.3.0",
"description": "Various wrapper classes I use in my projects", "description": "Various wrapper classes I use in my projects",
"repository": "https://git.corgi.wtf/Navy.gif/wrappers.git", "repository": "https://git.corgi.wtf/Navy.gif/wrappers.git",
"author": "Navy.gif", "author": "Navy.gif",

View File

@ -15,9 +15,9 @@ type Credentials = {
} }
export type MariaOptions = { export type MariaOptions = {
load: boolean, load?: boolean,
cluster: PoolClusterConfig, cluster?: PoolClusterConfig,
client: PoolConfig, client?: PoolConfig,
credentials: Credentials, credentials: Credentials,
loggerOptions?: LoggerClientOptions loggerOptions?: LoggerClientOptions
} }

View File

@ -14,8 +14,9 @@ type Credentials = {
export type MongoOptions = { export type MongoOptions = {
credentials: Credentials, credentials: Credentials,
loggerOptions: LoggerClientOptions, loggerOptions?: LoggerClientOptions,
client: MongoClientOptions client: MongoClientOptions,
load?: boolean
} }
/** /**
@ -90,6 +91,9 @@ class MongoDB {
*/ */
async init () { async init () {
if (this.#config.load)
return this.#logger.info('Not loading MongoDB');
this.#logger.status(`Initializing database connection to ${this.#_client.options.hosts}`); this.#logger.status(`Initializing database connection to ${this.#_client.options.hosts}`);
await this.#_client.connect(); await this.#_client.connect();