@gmahechas-org/common-be-ts-postgres 0.0.0-stage → 0.0.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.
@@ -0,0 +1,2 @@
1
+ export * from './lib/pg/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,4 @@
1
+ export * from './pg.ts';
2
+ export * from './pg.types.ts';
3
+ export * from './pg.values.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,3 @@
1
+ export * from './pg.js';
2
+ export * from './pg.types.js';
3
+ export * from './pg.values.js';
@@ -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,3 @@
1
+ export type { QueryResult, QueryResultRow } from 'pg';
2
+ export type { PostgresConfig } from '../../postgres-client-base.ts';
3
+ //# sourceMappingURL=pg.types.d.ts.map
@@ -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,2 @@
1
+ export { Pool } from 'pg';
2
+ //# sourceMappingURL=pg.values.d.ts.map
@@ -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"}
@@ -0,0 +1,6 @@
1
+ export class PostgresClientBase {
2
+ config;
3
+ constructor(config) {
4
+ this.config = config;
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
- "name": "@gmahechas-org/common-be-ts-postgres",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@gmahechas-org/common-be-ts-postgres",
3
+ "version": "0.0.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
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.