aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.h.kronqvist@gmail.com>2022-03-05 19:02:27 +0200
committerJoel Kronqvist <joel.h.kronqvist@gmail.com>2022-03-05 19:02:27 +0200
commit5d309ff52cd399a6b71968a6b9a70c8ac0b98981 (patch)
tree360f7eb50f956e2367ef38fa1fc6ac7ac5258042 /node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
parentb500a50f1b97d93c98b36ed9a980f8188d648147 (diff)
downloadLYLLRuoka-5d309ff52cd399a6b71968a6b9a70c8ac0b98981.tar.gz
LYLLRuoka-5d309ff52cd399a6b71968a6b9a70c8ac0b98981.zip
Added node_modules for the updating to work properly.
Diffstat (limited to 'node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts')
-rw-r--r--node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts56
1 files changed, 56 insertions, 0 deletions
diff --git a/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts b/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
new file mode 100644
index 0000000..92909ab
--- /dev/null
+++ b/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
@@ -0,0 +1,56 @@
+
+import Connection = require('./Connection');
+import PoolConnection = require('./PoolConnection');
+import {EventEmitter} from 'events';
+
+declare namespace PoolCluster {
+
+ export interface PoolClusterOptions {
+ /**
+ * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)
+ */
+ canRetry?: boolean;
+
+ /**
+ * If connection fails, node's errorCount increases. When errorCount is greater than removeNodeErrorCount,
+ * remove a node in the PoolCluster. (Default: 5)
+ */
+ removeNodeErrorCount?: number;
+
+ /**
+ * If connection fails, specifies the number of milliseconds before another connection attempt will be made.
+ * If set to 0, then node will be removed instead and never re-used. (Default: 0)
+ */
+ restoreNodeTimeout?: number;
+
+ /**
+ * The default selector. (Default: RR)
+ * RR: Select one alternately. (Round-Robin)
+ * RANDOM: Select the node by random function.
+ * ORDER: Select the first node available unconditionally.
+ */
+ defaultSelector?: string;
+ }
+}
+
+declare class PoolCluster extends EventEmitter {
+
+ config: PoolCluster.PoolClusterOptions;
+
+ add(config: PoolCluster.PoolClusterOptions): void;
+ add(group: string, config: PoolCluster.PoolClusterOptions): void;
+
+ end(): void;
+
+ getConnection(callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => void): void;
+ getConnection(group: string, callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => void): void;
+ getConnection(group: string, selector: string, callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => void): void;
+
+ of(pattern: string, selector?: string): PoolCluster;
+
+ on(event: string, listener: Function): this;
+ on(event: 'remove', listener: (nodeId: number) => void): this;
+ on(event: 'connection', listener: (connection: PoolConnection) => void): this;
+}
+
+export = PoolCluster;