@gmahechas-org/common-be-ts-postgres 0.0.0-stage → 8.23.0
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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/pg/index.d.ts +4 -0
- package/dist/lib/pg/index.d.ts.map +1 -0
- package/dist/lib/pg/index.js +3 -0
- package/dist/lib/pg/pg.d.ts +10 -0
- package/dist/lib/pg/pg.d.ts.map +1 -0
- package/dist/lib/pg/pg.js +15 -0
- package/dist/lib/pg/pg.types.d.ts +3 -0
- package/dist/lib/pg/pg.types.d.ts.map +1 -0
- package/dist/lib/pg/pg.types.js +1 -0
- package/dist/lib/pg/pg.values.d.ts +2 -0
- package/dist/lib/pg/pg.values.d.ts.map +1 -0
- package/dist/lib/pg/pg.values.js +1 -0
- package/dist/postgres-client-base.d.ts +10 -0
- package/dist/postgres-client-base.d.ts.map +1 -0
- package/dist/postgres-client-base.js +6 -0
- package/package.json +32 -5
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/pg/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/pg/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Pool } from 'pg';
|
|
2
|
+
import { PostgresClientBase } from '../../postgres-client-base.ts';
|
|
3
|
+
import type { PostgresConfig } from './pg.types.ts';
|
|
4
|
+
export declare class Postgres extends PostgresClientBase<PostgresConfig> {
|
|
5
|
+
readonly pool: Pool;
|
|
6
|
+
constructor(config: PostgresConfig);
|
|
7
|
+
connect(): Promise<void>;
|
|
8
|
+
disconnect(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg.d.ts","sourceRoot":"","sources":["../../../src/lib/pg/pg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,qBAAa,QAAS,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IAC/D,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B,YAAY,MAAM,EAAE,cAAc,EAGjC;IAEY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;IAEY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Pool } from 'pg';
|
|
2
|
+
import { PostgresClientBase } from '../../postgres-client-base.js';
|
|
3
|
+
export class Postgres extends PostgresClientBase {
|
|
4
|
+
pool;
|
|
5
|
+
constructor(config) {
|
|
6
|
+
super(config);
|
|
7
|
+
this.pool = new Pool({ connectionString: config.connectionString });
|
|
8
|
+
}
|
|
9
|
+
async connect() {
|
|
10
|
+
await this.pool.query('SELECT 1');
|
|
11
|
+
}
|
|
12
|
+
async disconnect() {
|
|
13
|
+
await this.pool.end();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg.types.d.ts","sourceRoot":"","sources":["../../../src/lib/pg/pg.types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEtD,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg.values.d.ts","sourceRoot":"","sources":["../../../src/lib/pg/pg.values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pool } from 'pg';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PostgresConfig {
|
|
2
|
+
connectionString: string;
|
|
3
|
+
}
|
|
4
|
+
export declare abstract class PostgresClientBase<C extends PostgresConfig = PostgresConfig> {
|
|
5
|
+
protected readonly config: C;
|
|
6
|
+
protected constructor(config: C);
|
|
7
|
+
abstract connect(): Promise<void>;
|
|
8
|
+
abstract disconnect(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=postgres-client-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-client-base.d.ts","sourceRoot":"","sources":["../src/postgres-client-base.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED,8BAAsB,kBAAkB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IACjF,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7B,SAAS,aAAa,MAAM,EAAE,CAAC,EAE9B;IAED,SAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,SAAgB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@gmahechas-org/common-be-ts-postgres",
|
|
3
|
+
"version": "8.23.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"dev": "./src/index.ts",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"!**/*.tsbuildinfo"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"cleanup": "rm -rf ./node_modules ./dist",
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"biome": "biome check --write ./src",
|
|
25
|
+
"prepack": "pnpm run build"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"pg": "8.23.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/pg": "8.23.1"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/README.md
DELETED