@sqb/postgres 4.2.1 → 4.5.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/README.md +67 -0
- package/{dist → cjs}/datatype-map.js +0 -0
- package/{dist → cjs}/index.js +2 -2
- package/cjs/package.json +3 -0
- package/{dist/PgAdapter.js → cjs/pg-adapter.js} +9 -11
- package/{dist/PgConnection.js → cjs/pg-connection.js} +3 -2
- package/{dist → esm}/datatype-map.d.ts +0 -0
- package/esm/datatype-map.js +28 -0
- package/{dist → esm}/index.d.ts +0 -0
- package/esm/index.js +4 -0
- package/{dist/PgAdapter.d.ts → esm/pg-adapter.d.ts} +0 -0
- package/esm/pg-adapter.js +37 -0
- package/{dist/PgConnection.d.ts → esm/pg-connection.d.ts} +0 -0
- package/esm/pg-connection.js +155 -0
- package/package.json +68 -53
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
<p style="text-align:center">
|
|
3
|
+
<img src="https://user-images.githubusercontent.com/3836517/32965280-1a2b63ce-cbe7-11e7-8ee1-ba47313503c5.png" width="500px" alt="SQB Logo"/>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<br>
|
|
7
|
+
|
|
8
|
+
[![NPM Version][npm-image]][npm-url]
|
|
9
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
10
|
+
[![Build Status][travis-image]][travis-url]
|
|
11
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
12
|
+
[![Dependencies][dependencies-image]][dependencies-url]
|
|
13
|
+
[![DevDependencies][devdependencies-image]][devdependencies-url]
|
|
14
|
+
[![Package Quality][quality-image]][quality-url]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## About SQB
|
|
18
|
+
|
|
19
|
+
SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS.
|
|
20
|
+
|
|
21
|
+
## Main goals
|
|
22
|
+
|
|
23
|
+
- Single code base for any sql based database
|
|
24
|
+
- Powerful and simplified query coding scheme
|
|
25
|
+
- Fast applications with low memory requirements
|
|
26
|
+
- Let applications work with large data tables efficiently
|
|
27
|
+
- Support latest JavaScript language standards
|
|
28
|
+
- Lightweight and extensible framework.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
You can report bugs and discuss features on the [GitHub issues](https://github.com/sqbjs/sqb/issues) page
|
|
32
|
+
|
|
33
|
+
Thanks to all of the great [contributions](https://github.com/sqbjs/sqb/graphs/contributors) to the project.
|
|
34
|
+
|
|
35
|
+
You may want to check detailed [DOCUMENTATION](https://sqbjs.github.io/sqb/)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
$ npm install @sqb/postgres --save
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Node Compatibility
|
|
45
|
+
|
|
46
|
+
- node >= 16.x
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### License
|
|
50
|
+
SQB is available under [MIT](LICENSE) license.
|
|
51
|
+
|
|
52
|
+
[npm-image]: https://img.shields.io/npm/v/@sqb/postgres.svg
|
|
53
|
+
[npm-url]: https://npmjs.org/package/@sqb/postgres
|
|
54
|
+
[travis-image]: https://img.shields.io/travis/sqbjs/@sqb/postgres/master.svg
|
|
55
|
+
[travis-url]: https://travis-ci.org/sqbjs/@sqb/postgres
|
|
56
|
+
[coveralls-image]: https://img.shields.io/coveralls/sqbjs/@sqb/postgres/master.svg
|
|
57
|
+
[coveralls-url]: https://coveralls.io/r/sqbjs/@sqb/postgres
|
|
58
|
+
[downloads-image]: https://img.shields.io/npm/dm/@sqb/postgres.svg
|
|
59
|
+
[downloads-url]: https://npmjs.org/package/@sqb/postgres
|
|
60
|
+
[gitter-image]: https://badges.gitter.im/sqbjs/@sqb/postgres.svg
|
|
61
|
+
[gitter-url]: https://gitter.im/sqbjs/@sqb/postgres?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
|
62
|
+
[dependencies-image]: https://david-dm.org/sqbjs/@sqb/postgres/status.svg
|
|
63
|
+
[dependencies-url]:https://david-dm.org/sqbjs/@sqb/postgres
|
|
64
|
+
[devdependencies-image]: https://david-dm.org/sqbjs/@sqb/postgres/dev-status.svg
|
|
65
|
+
[devdependencies-url]:https://david-dm.org/sqbjs/@sqb/postgres?type=dev
|
|
66
|
+
[quality-image]: http://npm.packagequality.com/shield/@sqb/postgres.png
|
|
67
|
+
[quality-url]: http://packagequality.com/#?package=@sqb/postgres
|
|
File without changes
|
package/{dist → cjs}/index.js
RENAMED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("@sqb/postgres-dialect");
|
|
4
4
|
const connect_1 = require("@sqb/connect");
|
|
5
|
-
const
|
|
6
|
-
(0, connect_1.registerAdapter)(new
|
|
5
|
+
const pg_adapter_js_1 = require("./pg-adapter.js");
|
|
6
|
+
(0, connect_1.registerAdapter)(new pg_adapter_js_1.PgAdapter());
|
package/cjs/package.json
ADDED
|
@@ -4,17 +4,15 @@ exports.PgAdapter = void 0;
|
|
|
4
4
|
require("@sqb/postgres-dialect");
|
|
5
5
|
const postgresql_client_1 = require("postgresql-client");
|
|
6
6
|
const connect_1 = require("@sqb/connect");
|
|
7
|
-
const
|
|
7
|
+
const pg_connection_js_1 = require("./pg-connection.js");
|
|
8
8
|
class PgAdapter {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}
|
|
9
|
+
driver = 'postgresql-client';
|
|
10
|
+
dialect = 'postgres';
|
|
11
|
+
features = {
|
|
12
|
+
cursor: true,
|
|
13
|
+
schema: true,
|
|
14
|
+
fetchAsString: [connect_1.DataType.DATE, connect_1.DataType.TIMESTAMP, connect_1.DataType.TIMESTAMPTZ]
|
|
15
|
+
};
|
|
18
16
|
async connect(config) {
|
|
19
17
|
const cfg = { ...config.driverOptions };
|
|
20
18
|
if (config.user)
|
|
@@ -32,7 +30,7 @@ class PgAdapter {
|
|
|
32
30
|
const connection = new postgresql_client_1.Connection(cfg);
|
|
33
31
|
try {
|
|
34
32
|
await connection.connect();
|
|
35
|
-
return new
|
|
33
|
+
return new pg_connection_js_1.PgConnection(connection);
|
|
36
34
|
}
|
|
37
35
|
catch (e) {
|
|
38
36
|
await connection.close(0);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PgConnection = void 0;
|
|
4
4
|
const postgresql_client_1 = require("postgresql-client");
|
|
5
5
|
const connect_1 = require("@sqb/connect");
|
|
6
|
-
const
|
|
6
|
+
const datatype_map_js_1 = require("./datatype-map.js");
|
|
7
7
|
const SqbDataTypToOIDMap = {
|
|
8
8
|
[connect_1.DataType.BOOL]: postgresql_client_1.DataTypeOIDs.bool,
|
|
9
9
|
[connect_1.DataType.CHAR]: postgresql_client_1.DataTypeOIDs.char,
|
|
@@ -23,6 +23,7 @@ const SqbDataTypToOIDMap = {
|
|
|
23
23
|
[connect_1.DataType.GUID]: postgresql_client_1.DataTypeOIDs.uuid,
|
|
24
24
|
};
|
|
25
25
|
class PgConnection {
|
|
26
|
+
intlcon;
|
|
26
27
|
constructor(conn) {
|
|
27
28
|
this.intlcon = conn;
|
|
28
29
|
}
|
|
@@ -101,7 +102,7 @@ class PgConnection {
|
|
|
101
102
|
const params = query.params?.map((v, i) => {
|
|
102
103
|
const paramOpts = Array.isArray(query.paramOptions) ? query.paramOptions[i] : undefined;
|
|
103
104
|
if (v != null && paramOpts && paramOpts.dataType) {
|
|
104
|
-
const oid = (0,
|
|
105
|
+
const oid = (0, datatype_map_js_1.dataTypeToOID)(paramOpts.dataType, paramOpts.isArray);
|
|
105
106
|
if (oid)
|
|
106
107
|
return new postgresql_client_1.BindParam(oid, v);
|
|
107
108
|
}
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataTypeOIDs } from 'postgresql-client';
|
|
2
|
+
import { DataType } from '@sqb/builder';
|
|
3
|
+
export function dataTypeToOID(dataType, isArray) {
|
|
4
|
+
if (dataType === DataType.DATE)
|
|
5
|
+
return isArray ? DataTypeOIDs._date : DataTypeOIDs.date;
|
|
6
|
+
if (dataType === DataType.BOOL)
|
|
7
|
+
return isArray ? DataTypeOIDs._bool : DataTypeOIDs.bool;
|
|
8
|
+
if (dataType === DataType.CHAR)
|
|
9
|
+
return isArray ? DataTypeOIDs._bpchar : DataTypeOIDs.bpchar;
|
|
10
|
+
if (dataType === DataType.SMALLINT)
|
|
11
|
+
return isArray ? DataTypeOIDs._int2 : DataTypeOIDs.int2;
|
|
12
|
+
if (dataType === DataType.INTEGER)
|
|
13
|
+
return isArray ? DataTypeOIDs._int4 : DataTypeOIDs.int4;
|
|
14
|
+
if (dataType === DataType.BIGINT)
|
|
15
|
+
return isArray ? DataTypeOIDs._int8 : DataTypeOIDs.int8;
|
|
16
|
+
if (dataType === DataType.BINARY)
|
|
17
|
+
return isArray ? DataTypeOIDs._bytea : DataTypeOIDs.bytea;
|
|
18
|
+
if (dataType === DataType.FLOAT)
|
|
19
|
+
return isArray ? DataTypeOIDs._float4 : DataTypeOIDs.float4;
|
|
20
|
+
if (dataType === DataType.DOUBLE)
|
|
21
|
+
return isArray ? DataTypeOIDs._float8 : DataTypeOIDs.float8;
|
|
22
|
+
if (dataType === DataType.GUID)
|
|
23
|
+
return isArray ? DataTypeOIDs._uuid : DataTypeOIDs.uuid;
|
|
24
|
+
if (dataType === DataType.TEXT)
|
|
25
|
+
return isArray ? DataTypeOIDs._text : DataTypeOIDs.text;
|
|
26
|
+
if (dataType === DataType.JSON)
|
|
27
|
+
return isArray ? DataTypeOIDs._json : DataTypeOIDs.json;
|
|
28
|
+
}
|
package/{dist → esm}/index.d.ts
RENAMED
|
File without changes
|
package/esm/index.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '@sqb/postgres-dialect';
|
|
2
|
+
import { Connection } from 'postgresql-client';
|
|
3
|
+
import { DataType } from '@sqb/connect';
|
|
4
|
+
import { PgConnection } from './pg-connection.js';
|
|
5
|
+
export class PgAdapter {
|
|
6
|
+
driver = 'postgresql-client';
|
|
7
|
+
dialect = 'postgres';
|
|
8
|
+
features = {
|
|
9
|
+
cursor: true,
|
|
10
|
+
schema: true,
|
|
11
|
+
fetchAsString: [DataType.DATE, DataType.TIMESTAMP, DataType.TIMESTAMPTZ]
|
|
12
|
+
};
|
|
13
|
+
async connect(config) {
|
|
14
|
+
const cfg = { ...config.driverOptions };
|
|
15
|
+
if (config.user)
|
|
16
|
+
cfg.user = config.user;
|
|
17
|
+
if (config.password)
|
|
18
|
+
cfg.password = config.password;
|
|
19
|
+
if (config.host)
|
|
20
|
+
cfg.host = config.host;
|
|
21
|
+
if (config.port)
|
|
22
|
+
cfg.port = config.port;
|
|
23
|
+
if (config.database)
|
|
24
|
+
cfg.database = config.database;
|
|
25
|
+
if (config.schema)
|
|
26
|
+
cfg.schema = config.schema;
|
|
27
|
+
const connection = new Connection(cfg);
|
|
28
|
+
try {
|
|
29
|
+
await connection.connect();
|
|
30
|
+
return new PgConnection(connection);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
await connection.close(0);
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { BindParam, DataTypeOIDs } from 'postgresql-client';
|
|
2
|
+
import { DataType } from '@sqb/connect';
|
|
3
|
+
import { dataTypeToOID } from './datatype-map.js';
|
|
4
|
+
const SqbDataTypToOIDMap = {
|
|
5
|
+
[DataType.BOOL]: DataTypeOIDs.bool,
|
|
6
|
+
[DataType.CHAR]: DataTypeOIDs.char,
|
|
7
|
+
[DataType.VARCHAR]: DataTypeOIDs.varchar,
|
|
8
|
+
[DataType.SMALLINT]: DataTypeOIDs.int2,
|
|
9
|
+
[DataType.INTEGER]: DataTypeOIDs.int4,
|
|
10
|
+
[DataType.BIGINT]: DataTypeOIDs.int8,
|
|
11
|
+
[DataType.FLOAT]: DataTypeOIDs.float4,
|
|
12
|
+
[DataType.DOUBLE]: DataTypeOIDs.float8,
|
|
13
|
+
[DataType.NUMBER]: DataTypeOIDs.float8,
|
|
14
|
+
[DataType.DATE]: DataTypeOIDs.date,
|
|
15
|
+
[DataType.TIMESTAMP]: DataTypeOIDs.timestamp,
|
|
16
|
+
[DataType.TIMESTAMPTZ]: DataTypeOIDs.timestamptz,
|
|
17
|
+
[DataType.TIME]: DataTypeOIDs.time,
|
|
18
|
+
[DataType.BINARY]: DataTypeOIDs.bytea,
|
|
19
|
+
[DataType.TEXT]: DataTypeOIDs.text,
|
|
20
|
+
[DataType.GUID]: DataTypeOIDs.uuid,
|
|
21
|
+
};
|
|
22
|
+
export class PgConnection {
|
|
23
|
+
intlcon;
|
|
24
|
+
constructor(conn) {
|
|
25
|
+
this.intlcon = conn;
|
|
26
|
+
}
|
|
27
|
+
get sessionId() {
|
|
28
|
+
return this.intlcon && this.intlcon.processID;
|
|
29
|
+
}
|
|
30
|
+
async close() {
|
|
31
|
+
if (!this.intlcon)
|
|
32
|
+
return;
|
|
33
|
+
await this.intlcon.close(0);
|
|
34
|
+
this.intlcon = undefined;
|
|
35
|
+
}
|
|
36
|
+
async reset() {
|
|
37
|
+
return this.rollback();
|
|
38
|
+
}
|
|
39
|
+
async startTransaction() {
|
|
40
|
+
if (!this.intlcon)
|
|
41
|
+
throw new Error('Can not start transaction for a closed db session');
|
|
42
|
+
await this.intlcon.startTransaction();
|
|
43
|
+
}
|
|
44
|
+
async commit() {
|
|
45
|
+
if (!this.intlcon)
|
|
46
|
+
throw new Error('Can not commit transaction for a closed db session');
|
|
47
|
+
await this.intlcon.commit();
|
|
48
|
+
}
|
|
49
|
+
async rollback() {
|
|
50
|
+
if (!this.intlcon)
|
|
51
|
+
return;
|
|
52
|
+
await this.intlcon.rollback();
|
|
53
|
+
}
|
|
54
|
+
async setSavepoint(savepoint) {
|
|
55
|
+
if (!this.intlcon)
|
|
56
|
+
throw new Error('Can not set savepoint for a closed db session');
|
|
57
|
+
return this.intlcon.savepoint(savepoint);
|
|
58
|
+
}
|
|
59
|
+
async releaseSavepoint(savepoint) {
|
|
60
|
+
if (!this.intlcon)
|
|
61
|
+
throw new Error('Can not release savepoint for a closed db session');
|
|
62
|
+
return this.intlcon.releaseSavepoint(savepoint);
|
|
63
|
+
}
|
|
64
|
+
async rollbackSavepoint(savepoint) {
|
|
65
|
+
if (!this.intlcon)
|
|
66
|
+
throw new Error('Can not rollback to a savepoint for a closed db session');
|
|
67
|
+
return this.intlcon.rollbackToSavepoint(savepoint);
|
|
68
|
+
}
|
|
69
|
+
getInTransaction() {
|
|
70
|
+
return !!(this.intlcon && this.intlcon.inTransaction);
|
|
71
|
+
}
|
|
72
|
+
async test() {
|
|
73
|
+
if (!this.intlcon)
|
|
74
|
+
throw new Error('DB session is closed');
|
|
75
|
+
await this.intlcon.query('select 1');
|
|
76
|
+
}
|
|
77
|
+
async getSchema() {
|
|
78
|
+
if (!this.intlcon)
|
|
79
|
+
throw new Error('DB session is closed');
|
|
80
|
+
const r = await this.intlcon.query('SHOW search_path');
|
|
81
|
+
if (r && r.rows && r.rows[0])
|
|
82
|
+
return r.rows[0][0];
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
async setSchema(schema) {
|
|
86
|
+
if (!this.intlcon)
|
|
87
|
+
throw new Error('Can not set schema of a closed db session');
|
|
88
|
+
await this.intlcon.execute('SET search_path TO ' + schema);
|
|
89
|
+
}
|
|
90
|
+
onGenerateQuery(request) {
|
|
91
|
+
if (this.intlcon) {
|
|
92
|
+
// eslint-disable-next-line dot-notation
|
|
93
|
+
request.dialectVersion = this.intlcon.sessionParameters['server_version'];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async execute(query) {
|
|
97
|
+
if (!this.intlcon)
|
|
98
|
+
throw new Error('Can not execute query with a closed db session');
|
|
99
|
+
const params = query.params?.map((v, i) => {
|
|
100
|
+
const paramOpts = Array.isArray(query.paramOptions) ? query.paramOptions[i] : undefined;
|
|
101
|
+
if (v != null && paramOpts && paramOpts.dataType) {
|
|
102
|
+
const oid = dataTypeToOID(paramOpts.dataType, paramOpts.isArray);
|
|
103
|
+
if (oid)
|
|
104
|
+
return new BindParam(oid, v);
|
|
105
|
+
}
|
|
106
|
+
return v;
|
|
107
|
+
});
|
|
108
|
+
const opts = {
|
|
109
|
+
autoCommit: query.autoCommit,
|
|
110
|
+
params,
|
|
111
|
+
cursor: query.cursor,
|
|
112
|
+
fetchCount: query.fetchRows,
|
|
113
|
+
objectRows: query.objectRows
|
|
114
|
+
};
|
|
115
|
+
if (query.fetchAsString) {
|
|
116
|
+
const items = query.fetchAsString.reduce((a, v) => {
|
|
117
|
+
const oid = SqbDataTypToOIDMap[v];
|
|
118
|
+
if (oid)
|
|
119
|
+
a.push(oid);
|
|
120
|
+
return a;
|
|
121
|
+
}, []);
|
|
122
|
+
if (items.length)
|
|
123
|
+
opts.fetchAsString = items;
|
|
124
|
+
}
|
|
125
|
+
const resp = await this.intlcon.query(query.sql, opts);
|
|
126
|
+
const out = {};
|
|
127
|
+
if (resp.fields)
|
|
128
|
+
out.fields = this._convertFields(resp.fields);
|
|
129
|
+
if (resp.rows)
|
|
130
|
+
out.rows = resp.rows;
|
|
131
|
+
if (resp.cursor)
|
|
132
|
+
out.cursor = resp.cursor;
|
|
133
|
+
if (resp.rowType)
|
|
134
|
+
out.rowType = resp.rowType;
|
|
135
|
+
if (resp.rowsAffected)
|
|
136
|
+
out.rowsAffected = resp.rowsAffected;
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
_convertFields(fields) {
|
|
140
|
+
const result = [];
|
|
141
|
+
for (let i = 0; i < fields.length; i++) {
|
|
142
|
+
const v = fields[i];
|
|
143
|
+
const o = {
|
|
144
|
+
fieldName: v.fieldName,
|
|
145
|
+
dataType: v.dataTypeName,
|
|
146
|
+
elementDataType: v.elementDataTypeName,
|
|
147
|
+
jsType: v.jsType,
|
|
148
|
+
isArray: v.isArray,
|
|
149
|
+
_inf: v
|
|
150
|
+
};
|
|
151
|
+
result.push(o);
|
|
152
|
+
}
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
}
|
package/package.json
CHANGED
|
@@ -1,63 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@sqb/postgres",
|
|
3
|
-
"description": "SQB serialization extension for PostgreSQL database",
|
|
4
|
-
"version": "4.
|
|
5
|
-
"author": "Panates",
|
|
6
|
-
"contributors": [
|
|
7
|
-
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
2
|
+
"name" : "@sqb/postgres",
|
|
3
|
+
"description" : "SQB serialization extension for PostgreSQL database",
|
|
4
|
+
"version" : "4.5.0",
|
|
5
|
+
"author" : "Panates",
|
|
6
|
+
"contributors" : [
|
|
7
|
+
"Eray Hanoglu <e.hanoglu@panates.com>",
|
|
8
|
+
"Ilker Gurelli <i.gurelli@panates.com>"
|
|
8
9
|
],
|
|
9
|
-
"license": "Apache-2.0",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/sqbjs/sqb.git",
|
|
13
|
-
"directory": "packages/postgres"
|
|
10
|
+
"license" : "Apache-2.0",
|
|
11
|
+
"repository" : {
|
|
12
|
+
"type" : "git",
|
|
13
|
+
"url" : "https://github.com/sqbjs/sqb.git",
|
|
14
|
+
"directory" : "packages/postgres"
|
|
14
15
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
16
|
+
"scripts" : {
|
|
17
|
+
"compile" : "tsc",
|
|
18
|
+
"prebuild" : "npm run lint && npm run clean",
|
|
19
|
+
"build" : "npm run build:cjs && npm run build:esm",
|
|
20
|
+
"build:cjs" : "tsc -b tsconfig-build-cjs.json",
|
|
21
|
+
"build:esm" : "tsc -b tsconfig-build-esm.json",
|
|
22
|
+
"postbuild" : "cp README.md package.json ../../LICENSE ../../build/postgres && cp ../../package.cjs.json ../../build/postgres/cjs/package.json",
|
|
23
|
+
"lint" : "eslint .",
|
|
24
|
+
"test" : "jest",
|
|
25
|
+
"cover" : "jest --collect-coverage",
|
|
26
|
+
"clean" : "npm run clean:src | npm run clean:dist | npm run clean:cover",
|
|
27
|
+
"clean:src" : "ts-cleanup -s src --all",
|
|
28
|
+
"clean:dist" : "rimraf ../../build/postgres",
|
|
29
|
+
"clean:cover" : "rimraf ../../coverage/postgres"
|
|
29
30
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
31
|
+
"dependencies" : {
|
|
32
|
+
"putil-promisify" : "^1.8.5"
|
|
32
33
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"@sqb/connect": "^4.2.0",
|
|
36
|
-
"@sqb/postgres-dialect": "^4.2.0",
|
|
37
|
-
"postgresql-client": "^2.0.0"
|
|
34
|
+
"devDependencies" : {
|
|
35
|
+
"postgresql-client" : "^2.1.5"
|
|
38
36
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
37
|
+
"peerDependencies" : {
|
|
38
|
+
"@sqb/builder" : "^4.5.0",
|
|
39
|
+
"@sqb/connect" : "^4.5.0",
|
|
40
|
+
"@sqb/postgres-dialect" : "^4.5.0",
|
|
41
|
+
"postgresql-client" : "^2.x.x"
|
|
43
42
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
"type" : "module",
|
|
44
|
+
"main" : "cjs/index.js",
|
|
45
|
+
"module" : "esm/index.js",
|
|
46
|
+
"types" : "esm/index.d.ts",
|
|
47
|
+
"exports" : {
|
|
48
|
+
"." : {
|
|
49
|
+
"require" : "./cjs/index.js",
|
|
50
|
+
"default" : "./esm/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./cjs" : "./cjs/index.js",
|
|
53
|
+
"./esm" : "./esm/index.js"
|
|
47
54
|
},
|
|
48
|
-
"
|
|
55
|
+
"engines" : {
|
|
56
|
+
"node" : ">=16.0",
|
|
57
|
+
"npm" : ">=7.0.0"
|
|
58
|
+
},
|
|
59
|
+
"files" : [
|
|
60
|
+
"bin/",
|
|
61
|
+
"cjs/",
|
|
62
|
+
"esm/",
|
|
49
63
|
"LICENSE",
|
|
50
|
-
"README"
|
|
51
|
-
"dist/"
|
|
64
|
+
"README.md"
|
|
52
65
|
],
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
"keywords" : [
|
|
67
|
+
"sqb",
|
|
68
|
+
"postgressql",
|
|
69
|
+
"postgres",
|
|
70
|
+
"pg",
|
|
71
|
+
"sql",
|
|
72
|
+
"query",
|
|
73
|
+
"builder",
|
|
74
|
+
"dialect",
|
|
75
|
+
"serializer",
|
|
76
|
+
"database"
|
|
77
|
+
]
|
|
78
|
+
}
|