@sqb/postgres 4.9.0 → 4.10.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/cjs/index.js +2 -0
- package/cjs/pg-adapter.js +9 -7
- package/cjs/pg-connection.js +0 -1
- package/esm/index.js +1 -0
- package/esm/pg-adapter.js +9 -7
- package/esm/pg-connection.js +0 -1
- package/package.json +10 -16
- package/esm/datatype-map.d.ts +0 -3
- package/esm/index.d.ts +0 -1
- package/esm/pg-adapter.d.ts +0 -12
- package/esm/pg-connection.d.ts +0 -22
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
require("@sqb/postgres-dialect");
|
|
4
5
|
const connect_1 = require("@sqb/connect");
|
|
5
6
|
const pg_adapter_js_1 = require("./pg-adapter.js");
|
|
6
7
|
(0, connect_1.registerAdapter)(new pg_adapter_js_1.PgAdapter());
|
|
8
|
+
tslib_1.__exportStar(require("./pg-adapter.js"), exports);
|
package/cjs/pg-adapter.js
CHANGED
|
@@ -6,13 +6,15 @@ const postgresql_client_1 = require("postgresql-client");
|
|
|
6
6
|
const connect_1 = require("@sqb/connect");
|
|
7
7
|
const pg_connection_js_1 = require("./pg-connection.js");
|
|
8
8
|
class PgAdapter {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
constructor() {
|
|
10
|
+
this.driver = 'postgresql-client';
|
|
11
|
+
this.dialect = 'postgres';
|
|
12
|
+
this.features = {
|
|
13
|
+
cursor: true,
|
|
14
|
+
schema: true,
|
|
15
|
+
fetchAsString: [connect_1.DataType.DATE, connect_1.DataType.TIMESTAMP, connect_1.DataType.TIMESTAMPTZ]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
16
18
|
async connect(config) {
|
|
17
19
|
const cfg = { ...config.driverOptions };
|
|
18
20
|
if (config.user)
|
package/cjs/pg-connection.js
CHANGED
package/esm/index.js
CHANGED
package/esm/pg-adapter.js
CHANGED
|
@@ -3,13 +3,15 @@ import { Connection } from 'postgresql-client';
|
|
|
3
3
|
import { DataType } from '@sqb/connect';
|
|
4
4
|
import { PgConnection } from './pg-connection.js';
|
|
5
5
|
export class PgAdapter {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
this.driver = 'postgresql-client';
|
|
8
|
+
this.dialect = 'postgres';
|
|
9
|
+
this.features = {
|
|
10
|
+
cursor: true,
|
|
11
|
+
schema: true,
|
|
12
|
+
fetchAsString: [DataType.DATE, DataType.TIMESTAMP, DataType.TIMESTAMPTZ]
|
|
13
|
+
};
|
|
14
|
+
}
|
|
13
15
|
async connect(config) {
|
|
14
16
|
const cfg = { ...config.driverOptions };
|
|
15
17
|
if (config.user)
|
package/esm/pg-connection.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/postgres",
|
|
3
3
|
"description": "SQB serialization extension for PostgreSQL database",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.10.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"url": "https://github.com/sqbjs/sqb.git",
|
|
14
14
|
"directory": "packages/postgres"
|
|
15
15
|
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"module": "./esm/index.js",
|
|
18
|
+
"main": "./cjs/index.js",
|
|
19
|
+
"types": "./types/index.d.ts",
|
|
16
20
|
"scripts": {
|
|
17
21
|
"compile": "tsc",
|
|
18
22
|
"prebuild": "npm run lint && npm run clean",
|
|
@@ -29,27 +33,17 @@
|
|
|
29
33
|
"clean:cover": "rimraf ../../coverage/postgres"
|
|
30
34
|
},
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"putil-promisify": "^1.10.
|
|
36
|
+
"putil-promisify": "^1.10.1"
|
|
33
37
|
},
|
|
34
38
|
"devDependencies": {
|
|
35
|
-
"postgresql-client": "^2.
|
|
39
|
+
"postgresql-client": "^2.10.1"
|
|
36
40
|
},
|
|
37
41
|
"peerDependencies": {
|
|
38
|
-
"@sqb/builder": "^4.
|
|
39
|
-
"@sqb/connect": "^4.
|
|
40
|
-
"@sqb/postgres-dialect": "^4.
|
|
42
|
+
"@sqb/builder": "^4.10.0",
|
|
43
|
+
"@sqb/connect": "^4.10.0",
|
|
44
|
+
"@sqb/postgres-dialect": "^4.10.0",
|
|
41
45
|
"postgresql-client": "^2.x.x"
|
|
42
46
|
},
|
|
43
|
-
"type": "module",
|
|
44
|
-
"types": "esm/index.d.ts",
|
|
45
|
-
"exports": {
|
|
46
|
-
".": {
|
|
47
|
-
"require": "./cjs/index.js",
|
|
48
|
-
"default": "./esm/index.js"
|
|
49
|
-
},
|
|
50
|
-
"./cjs": "./cjs/index.js",
|
|
51
|
-
"./esm": "./esm/index.js"
|
|
52
|
-
},
|
|
53
47
|
"engines": {
|
|
54
48
|
"node": ">=16.0",
|
|
55
49
|
"npm": ">=7.0.0"
|
package/esm/datatype-map.d.ts
DELETED
package/esm/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@sqb/postgres-dialect';
|
package/esm/pg-adapter.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import '@sqb/postgres-dialect';
|
|
2
|
-
import { Adapter, ClientConfiguration, DataType } from '@sqb/connect';
|
|
3
|
-
export declare class PgAdapter implements Adapter {
|
|
4
|
-
driver: string;
|
|
5
|
-
dialect: string;
|
|
6
|
-
features: {
|
|
7
|
-
cursor: boolean;
|
|
8
|
-
schema: boolean;
|
|
9
|
-
fetchAsString: DataType[];
|
|
10
|
-
};
|
|
11
|
-
connect(config: ClientConfiguration): Promise<Adapter.Connection>;
|
|
12
|
-
}
|
package/esm/pg-connection.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Connection, FieldInfo } from 'postgresql-client';
|
|
2
|
-
import { Adapter, QueryRequest } from '@sqb/connect';
|
|
3
|
-
export declare class PgConnection implements Adapter.Connection {
|
|
4
|
-
private intlcon?;
|
|
5
|
-
constructor(conn: Connection);
|
|
6
|
-
get sessionId(): any;
|
|
7
|
-
close(): Promise<void>;
|
|
8
|
-
reset(): Promise<void>;
|
|
9
|
-
startTransaction(): Promise<void>;
|
|
10
|
-
commit(): Promise<void>;
|
|
11
|
-
rollback(): Promise<void>;
|
|
12
|
-
setSavepoint(savepoint: string): Promise<void>;
|
|
13
|
-
releaseSavepoint(savepoint: string): Promise<void>;
|
|
14
|
-
rollbackSavepoint(savepoint: string): Promise<void>;
|
|
15
|
-
getInTransaction(): boolean;
|
|
16
|
-
test(): Promise<void>;
|
|
17
|
-
getSchema(): Promise<string>;
|
|
18
|
-
setSchema(schema: string): Promise<void>;
|
|
19
|
-
onGenerateQuery(request: QueryRequest): void;
|
|
20
|
-
execute(query: QueryRequest): Promise<Adapter.Response>;
|
|
21
|
-
_convertFields(fields: FieldInfo[]): any[];
|
|
22
|
-
}
|