@pi-r/postgres 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/pool.d.ts +8 -8
- package/client/pool.js +1 -1
- package/package.json +30 -30
- package/types/index.d.ts +13 -13
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @pi-r/postgres
|
|
2
|
-
|
|
3
|
-
https://e-mc.readthedocs.io/en/latest/db/postgres.html
|
|
4
|
-
|
|
5
|
-
### LICENSE
|
|
6
|
-
|
|
1
|
+
### @pi-r/postgres
|
|
2
|
+
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/db/postgres.html
|
|
4
|
+
|
|
5
|
+
### LICENSE
|
|
6
|
+
|
|
7
7
|
MIT
|
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, PostgresDataSource } from '../types';
|
|
4
|
-
|
|
5
|
-
import type { Pool, PoolClient } from 'pg';
|
|
6
|
-
|
|
7
|
-
declare const PostgresPool: DbPoolConstructor<PostgresDataSource, Pool, PoolClient, DbPoolCredential>;
|
|
8
|
-
|
|
1
|
+
import type { DbPoolConstructor } from '@e-mc/types/lib/db';
|
|
2
|
+
|
|
3
|
+
import type { DbPoolCredential, PostgresDataSource } from '../types';
|
|
4
|
+
|
|
5
|
+
import type { Pool, PoolClient } from 'pg';
|
|
6
|
+
|
|
7
|
+
declare const PostgresPool: DbPoolConstructor<PostgresDataSource, Pool, PoolClient, DbPoolCredential>;
|
|
8
|
+
|
|
9
9
|
export = PostgresPool;
|
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 PostgresPool extends DbPool {
|
|
6
|
-
static CACHE_UNUSED = ['keepAlive', 'statement_timeout', 'query_timeout', 'keepAliveInitialDelayMillis', 'idle_in_transaction_session_timeout', 'connectionTimeoutMillis', 'max', 'min', 'idleTimeoutMillis', 'log', 'allowExitOnIdle', 'maxUses'];
|
|
7
6
|
static asString(credential) {
|
|
8
7
|
if (credential.host && credential.user) {
|
|
9
8
|
return JSON.stringify(this.removeUUIDKey(credential));
|
|
@@ -52,4 +51,5 @@ class PostgresPool extends DbPool {
|
|
|
52
51
|
return this.client.ended;
|
|
53
52
|
}
|
|
54
53
|
}
|
|
54
|
+
PostgresPool.CACHE_UNUSED = ['keepAlive', 'statement_timeout', 'query_timeout', 'keepAliveInitialDelayMillis', 'idle_in_transaction_session_timeout', 'connectionTimeoutMillis', 'max', 'min', 'idleTimeoutMillis', 'log', 'allowExitOnIdle', 'maxUses'];
|
|
55
55
|
module.exports = PostgresPool;
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pi-r/postgres",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "PostgreSQL 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/postgres"
|
|
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
|
-
"pg": "^8.
|
|
27
|
-
"pg-connection-string": "^2.
|
|
28
|
-
"pg-query-stream": "^4.
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pi-r/postgres",
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "PostgreSQL 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/postgres"
|
|
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
|
+
"pg": "^8.13.0",
|
|
27
|
+
"pg-connection-string": "^2.7.0",
|
|
28
|
+
"pg-query-stream": "^4.7.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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
|
-
// @ts-ignore
|
|
7
|
-
import type { PoolConfig, QueryArrayConfig } from 'pg';
|
|
8
|
-
|
|
9
|
-
export interface PostgresDataSource<T = unknown[]> extends DbDataSource<string | QueryArrayConfig, unknown, unknown, PostgresCredential, string>, ExecuteAction<T> {
|
|
10
|
-
source: "postgres";
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PostgresCredential extends Omit<ServerAuth, "password">, PoolConfig {}
|
|
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
|
+
// @ts-ignore
|
|
7
|
+
import type { PoolConfig, QueryArrayConfig } from 'pg';
|
|
8
|
+
|
|
9
|
+
export interface PostgresDataSource<T = unknown[]> extends DbDataSource<string | QueryArrayConfig, unknown, unknown, PostgresCredential, string>, ExecuteAction<T> {
|
|
10
|
+
source: "postgres";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PostgresCredential extends Omit<ServerAuth, "password">, PoolConfig {}
|
|
14
14
|
export type DbPoolCredential = PoolConfig & IdentifierAction;
|