Compare commits
4 Commits
4240e978cf
...
1a45c35090
Author | SHA1 | Date | |
---|---|---|---|
1a45c35090 | |||
e3e7623c27 | |||
a82dacdc30 | |||
8230fa376b |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@navy.gif/wrappers",
|
"name": "@navy.gif/wrappers",
|
||||||
"version": "1.6.4",
|
"version": "1.6.6",
|
||||||
"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",
|
||||||
|
@ -337,6 +337,9 @@ class MariaDB
|
|||||||
const pool = this.#pool;
|
const pool = this.#pool;
|
||||||
if (nodeName)
|
if (nodeName)
|
||||||
{
|
{
|
||||||
|
const available = this.#nodes.filter(n => n.status === 'synced');
|
||||||
|
if (!available.length)
|
||||||
|
throw new Error('No nodes available for query');
|
||||||
const node = this.#nodes.find(n => n.name === nodeName);
|
const node = this.#nodes.find(n => n.name === nodeName);
|
||||||
if (!node)
|
if (!node)
|
||||||
{
|
{
|
||||||
@ -391,7 +394,7 @@ class MariaDB
|
|||||||
resolve(fields);
|
resolve(fields);
|
||||||
connection.release();
|
connection.release();
|
||||||
});
|
});
|
||||||
this.#logger.debug(`Constructed query: ${q.sql}`);
|
this.#logger.debug(`Constructed query: ${q.sql.substring(0, 1024)}`);
|
||||||
});
|
});
|
||||||
return Promise.resolve(result || []);
|
return Promise.resolve(result || []);
|
||||||
}
|
}
|
||||||
@ -421,7 +424,7 @@ class MariaDB
|
|||||||
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);
|
||||||
this.#logger.debug(`Incoming query (batch: ${batch})\n${query}\n${inspect(values)}`);
|
this.#logger.debug(`Incoming query (batch: ${batch})\n${query}\n${inspect(values).substring(0, 1024)}`);
|
||||||
|
|
||||||
return this.#_query<T>(query, values ?? [], opts);
|
return this.#_query<T>(query, values ?? [], opts);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user