@pi-r/mariadb 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/client/index.d.ts +10 -10
- package/client/pool.d.ts +8 -8
- package/client/pool.js +1 -1
- package/package.json +28 -28
- package/types/index.d.ts +12 -12
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @pi-r/mariadb
|
|
2
|
-
|
|
3
|
-
https://e-mc.readthedocs.io/en/latest/db/mariadb.html
|
|
4
|
-
|
|
5
|
-
### LICENSE
|
|
6
|
-
|
|
1
|
+
### @pi-r/mariadb
|
|
2
|
+
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/db/mariadb.html
|
|
4
|
+
|
|
5
|
+
### LICENSE
|
|
6
|
+
|
|
7
7
|
MIT
|
package/client/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IDb } from '@e-mc/types/lib';
|
|
2
|
-
|
|
3
|
-
import type { IDbSourceClient } from '@e-mc/db/types';
|
|
4
|
-
|
|
5
|
-
import type { MariaDBCredential, MariaDBDataSource } from '../types';
|
|
6
|
-
|
|
7
|
-
declare const MariaDB: IDbSourceClient<MariaDBDataSource> & {
|
|
8
|
-
setAuthentication(this: IDb, credential: MariaDBCredential): void;
|
|
9
|
-
};
|
|
10
|
-
|
|
1
|
+
import type { IDb } from '@e-mc/types/lib';
|
|
2
|
+
|
|
3
|
+
import type { IDbSourceClient } from '@e-mc/db/types';
|
|
4
|
+
|
|
5
|
+
import type { MariaDBCredential, MariaDBDataSource } from '../types';
|
|
6
|
+
|
|
7
|
+
declare const MariaDB: IDbSourceClient<MariaDBDataSource> & {
|
|
8
|
+
setAuthentication(this: IDb, credential: MariaDBCredential): void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
11
|
export = MariaDB;
|
package/client/pool.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { DbPoolConstructor } from '@e-mc/types/lib/db';
|
|
2
|
-
|
|
3
|
-
import type { DbPoolCredential, MariaDBDataSource } from '../types';
|
|
4
|
-
|
|
5
|
-
import type { Pool, PoolConnection } from 'mariadb';
|
|
6
|
-
|
|
7
|
-
declare const MariaDBPool: DbPoolConstructor<MariaDBDataSource, Pool, PoolConnection, DbPoolCredential>;
|
|
8
|
-
|
|
1
|
+
import type { DbPoolConstructor } from '@e-mc/types/lib/db';
|
|
2
|
+
|
|
3
|
+
import type { DbPoolCredential, MariaDBDataSource } from '../types';
|
|
4
|
+
|
|
5
|
+
import type { Pool, PoolConnection } from 'mariadb';
|
|
6
|
+
|
|
7
|
+
declare const MariaDBPool: DbPoolConstructor<MariaDBDataSource, Pool, PoolConnection, DbPoolCredential>;
|
|
8
|
+
|
|
9
9
|
export = MariaDBPool;
|
package/client/pool.js
CHANGED
|
@@ -3,7 +3,6 @@ const types_1 = require("@e-mc/types");
|
|
|
3
3
|
const DbPool = require('@e-mc/db/pool');
|
|
4
4
|
const POOL_ACTIVE = new WeakSet();
|
|
5
5
|
class MariaDBPool extends DbPool {
|
|
6
|
-
static CACHE_UNUSED = ['connectTimeout', 'socketTimeout', 'compress', 'keepAliveDelay', 'acquireTimeout', 'connectionLimit', 'idleTimeout', 'initializationTimeout', 'minDelayValidation', 'minimumIdle', 'resetAfterUse', 'noControlAfterUse', 'leakDetectionTimeout'];
|
|
7
6
|
static asString(credential) {
|
|
8
7
|
if ((credential.host || credential.socketPath) && credential.user) {
|
|
9
8
|
return JSON.stringify(this.removeUUIDKey(credential));
|
|
@@ -53,4 +52,5 @@ class MariaDBPool extends DbPool {
|
|
|
53
52
|
return this.client.closed;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
55
|
+
MariaDBPool.CACHE_UNUSED = ['connectTimeout', 'socketTimeout', 'compress', 'keepAliveDelay', 'acquireTimeout', 'connectionLimit', 'idleTimeout', 'initializationTimeout', 'minDelayValidation', 'minimumIdle', 'resetAfterUse', 'noControlAfterUse', 'leakDetectionTimeout'];
|
|
56
56
|
module.exports = MariaDBPool;
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pi-r/mariadb",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "MariaDB client driver for E-mc.",
|
|
5
|
-
"main": "client/index.js",
|
|
6
|
-
"types": "client/index.d.ts",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
13
|
-
"directory": "src/db/mariadb"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"squared",
|
|
17
|
-
"e-mc",
|
|
18
|
-
"squared-functions"
|
|
19
|
-
],
|
|
20
|
-
"author": "An Pham <anpham6@gmail.com>",
|
|
21
|
-
"license": "MIT",
|
|
22
|
-
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.10.
|
|
25
|
-
"@e-mc/types": "^0.10.
|
|
26
|
-
"mariadb": "^3.3.
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pi-r/mariadb",
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "MariaDB client driver for E-mc.",
|
|
5
|
+
"main": "client/index.js",
|
|
6
|
+
"types": "client/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
13
|
+
"directory": "src/db/mariadb"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"squared",
|
|
17
|
+
"e-mc",
|
|
18
|
+
"squared-functions"
|
|
19
|
+
],
|
|
20
|
+
"author": "An Pham <anpham6@gmail.com>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@e-mc/db": "^0.10.3",
|
|
25
|
+
"@e-mc/types": "^0.10.3",
|
|
26
|
+
"mariadb": "^3.3.2"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { DbDataSource } from '@e-mc/types/lib/squared';
|
|
2
|
-
|
|
3
|
-
import type { IdentifierAction } from '@e-mc/types/lib/core';
|
|
4
|
-
import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
|
|
5
|
-
|
|
6
|
-
import type { PoolConfig, QueryConfig } from 'mariadb';
|
|
7
|
-
|
|
8
|
-
export interface MariaDBDataSource<T = unknown> extends DbDataSource<string | QueryConfig, unknown, unknown, MariaDBCredential, string>, ExecuteAction<T> {
|
|
9
|
-
source: "mariadb";
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type MariaDBCredential = PoolConfig & ServerAuth;
|
|
1
|
+
import type { DbDataSource } from '@e-mc/types/lib/squared';
|
|
2
|
+
|
|
3
|
+
import type { IdentifierAction } from '@e-mc/types/lib/core';
|
|
4
|
+
import type { ExecuteAction, ServerAuth } from '@e-mc/types/lib/db';
|
|
5
|
+
|
|
6
|
+
import type { PoolConfig, QueryConfig } from 'mariadb';
|
|
7
|
+
|
|
8
|
+
export interface MariaDBDataSource<T = unknown> extends DbDataSource<string | QueryConfig, unknown, unknown, MariaDBCredential, string>, ExecuteAction<T> {
|
|
9
|
+
source: "mariadb";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type MariaDBCredential = PoolConfig & ServerAuth;
|
|
13
13
|
export type DbPoolCredential = PoolConfig & IdentifierAction;
|