postgrejs 2.21.0 → 2.21.1
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/CHANGELOG.md +28 -0
- package/README.md +8 -8
- package/cjs/connection/connection.js +9 -4
- package/cjs/protocol/pg-socket.js +12 -9
- package/esm/connection/connection.js +9 -4
- package/esm/protocol/pg-socket.js +8 -5
- package/package.json +1 -1
- package/types/connection/bind-param.d.ts +1 -1
- package/types/connection/connection.d.ts +9 -9
- package/types/connection/cursor.d.ts +5 -5
- package/types/connection/pool.d.ts +8 -8
- package/types/connection/portal.d.ts +3 -3
- package/types/connection/prepared-statement.d.ts +5 -5
- package/types/data-types/bool-type.d.ts +1 -1
- package/types/interfaces/command-result.d.ts +1 -1
- package/types/interfaces/data-type.d.ts +1 -2
- package/types/protocol/frontend.d.ts +4 -4
- package/types/protocol/pg-socket.d.ts +2 -2
- package/types/protocol/protocol.d.ts +1 -1
- package/types/util/config-from-env.d.ts +1 -1
- package/types/util/convert-row-to-object.d.ts +1 -1
- package/types/util/decode-binaryarray.d.ts +1 -1
- package/types/util/encode-binaryarray.d.ts +1 -2
- package/types/util/get-parsers.d.ts +3 -3
- package/types/util/parse-row.d.ts +2 -2
- package/types/util/stringify-arrayliteral.d.ts +2 -2
- package/types/util/stringify-for-sql.d.ts +2 -2
- package/types/util/wrap-row-description.d.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# v2.21.1
|
|
2
|
+
[2024-09-20]
|
|
3
|
+
|
|
4
|
+
### Fixes
|
|
5
|
+
|
|
6
|
+
* fix: Fixed error messages not showing issue ([`b1ac9be`](https://github.com/panates/postgrejs/commit/b1ac9be100941cf4a400ec0203934f23fd8189ba))
|
|
7
|
+
* fix: unix socket connection issue ([`1653631`](https://github.com/panates/postgrejs/commit/1653631567361b244b21acb7fcd6c863c7fd747a))
|
|
8
|
+
|
|
9
|
+
### Changes
|
|
10
|
+
|
|
11
|
+
* chore: Move CI from circleci to GitHub Actions ([`e5e6d4d`](https://github.com/panates/postgrejs/commit/e5e6d4daaab6a25fee2d9ebf5ecd8eb0c88b279f))
|
|
12
|
+
* chore: updated dependencies ([`0166983`](https://github.com/panates/postgrejs/commit/0166983503a6349adca87ca486b01e3215e185f9))
|
|
13
|
+
* chore: updated ci urls ([`f8ccd6f`](https://github.com/panates/postgrejs/commit/f8ccd6fabce1ded8b787974d2b9d0362e058eadd))
|
|
14
|
+
* chore: Move CI from circleci to GitHub Actions #13 ([`31e94bb`](https://github.com/panates/postgrejs/commit/31e94bb6e75bf645774ae06da3a0e1f4e73f0ea4))
|
|
15
|
+
* chore: Added coveralls support ([`9deda5f`](https://github.com/panates/postgrejs/commit/9deda5fe53f9b8d7a7b07ce17942b23d862395ea))
|
|
16
|
+
* chore: Move CI from circleci to GitHub Actions #8 ([`d5e2af2`](https://github.com/panates/postgrejs/commit/d5e2af29acc116fe2ad9cb91cda7fac3b11662bc))
|
|
17
|
+
* chore: Move CI from circleci to GitHub Actions #12 ([`2088d6a`](https://github.com/panates/postgrejs/commit/2088d6a8ff268af072d6d511979c8d4812972520))
|
|
18
|
+
* chore: Move CI from circleci to GitHub Actions #7 ([`8bacf98`](https://github.com/panates/postgrejs/commit/8bacf988825ef623a1c61a2471b83a685f66e924))
|
|
19
|
+
* chore: Move CI from circleci to GitHub Actions #9 ([`b7211e9`](https://github.com/panates/postgrejs/commit/b7211e9e3a62d1eb3af0b87c0fb536f03a32979d))
|
|
20
|
+
* chore: Move CI from circleci to GitHub Actions #6 ([`af38576`](https://github.com/panates/postgrejs/commit/af385760348e5f1fe60313115ff170c848ddc4ce))
|
|
21
|
+
* chore: Move CI from circleci to GitHub Actions #4 ([`6c260f5`](https://github.com/panates/postgrejs/commit/6c260f5d40893433684743ab55f707d0a63c0b76))
|
|
22
|
+
* chore: Move CI from circleci to GitHub Actions #5 ([`dbe687e`](https://github.com/panates/postgrejs/commit/dbe687e7f8719eb3d25ef24f9b4dc790917e8c2d))
|
|
23
|
+
* chore: Added node 16, 20, pg 16 ([`7458917`](https://github.com/panates/postgrejs/commit/74589172982861911968f93e6d5418f12dc17c63))
|
|
24
|
+
* chore: Move CI from circleci to GitHub Actions #10 ([`8144035`](https://github.com/panates/postgrejs/commit/814403556531dc79ac5d1fb46e7620123b4f2766))
|
|
25
|
+
* chore: Move CI from circleci to GitHub Actions #11 ([`a758c38`](https://github.com/panates/postgrejs/commit/a758c3806eb0cb80ac4d1ffac0cdde47b54d9c8a))
|
|
26
|
+
* chore: Move CI from circleci to GitHub Actions ([`485c398`](https://github.com/panates/postgrejs/commit/485c398fee7e45d4ab623157e1d601003b44b3f1))
|
|
27
|
+
* chore: Move CI from circleci to GitHub Actions #3 ([`187f12f`](https://github.com/panates/postgrejs/commit/187f12f2fe3364aa758147dbebad062f60bfc690))
|
|
28
|
+
|
|
1
29
|
# v2.21.0
|
|
2
30
|
[2024-09-14]
|
|
3
31
|
|
package/README.md
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
[![NPM Version][npm-image]][npm-url]
|
|
9
9
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
10
|
-
[![
|
|
10
|
+
[![CI Tests][ci-test-image]][ci-test-url]
|
|
11
11
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
PostgreJS is
|
|
14
|
+
PostgreJS is an enterprise-level PostgreSQL client for Node.js.
|
|
15
15
|
It is designed to provide a robust and efficient interface to PostgreSQL databases,
|
|
16
16
|
ensuring high performance and reliability for enterprise applications.
|
|
17
17
|
Written entirely in TypeScript, it leverages modern JavaScript features to deliver a seamless development experience.
|
|
@@ -63,7 +63,7 @@ Please read :small_orange_diamond: [DOCUMENTATION](https://postgrejs.panates.com
|
|
|
63
63
|
### Establish a single connection, execute a simple query
|
|
64
64
|
|
|
65
65
|
```ts
|
|
66
|
-
import {Connection} from 'postgrejs';
|
|
66
|
+
import { Connection } from 'postgrejs';
|
|
67
67
|
// Create connection
|
|
68
68
|
const connection = new Connection('postgres://localhost');
|
|
69
69
|
// Connect to database server
|
|
@@ -82,7 +82,7 @@ await connection.close();
|
|
|
82
82
|
|
|
83
83
|
### Establish a pooled connection, create a cursor
|
|
84
84
|
```ts
|
|
85
|
-
import {Pool} from 'postgrejs';
|
|
85
|
+
import { Pool } from 'postgrejs';
|
|
86
86
|
|
|
87
87
|
// Create connection pool
|
|
88
88
|
const db = new Pool({
|
|
@@ -114,7 +114,7 @@ await db.close();
|
|
|
114
114
|
|
|
115
115
|
### Using prepared statements
|
|
116
116
|
```ts
|
|
117
|
-
import {DataTypeOIDs} from 'postgrejs';
|
|
117
|
+
import { DataTypeOIDs } from 'postgrejs';
|
|
118
118
|
|
|
119
119
|
// .....
|
|
120
120
|
const statement = await connection.prepare(
|
|
@@ -196,12 +196,12 @@ When you open an issue please provide version of NodeJS and PostgreSQL server.
|
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
## License
|
|
199
|
-
|
|
199
|
+
PostgreJS is available under [MIT](LICENSE) license.
|
|
200
200
|
|
|
201
201
|
[npm-image]: https://img.shields.io/npm/v/postgrejs
|
|
202
202
|
[npm-url]: https://npmjs.org/package/postgrejs
|
|
203
|
-
[
|
|
204
|
-
[
|
|
203
|
+
[ci-test-image]: https://github.com/panates/postgrejs/actions/workflows/test.yml/badge.svg
|
|
204
|
+
[ci-test-url]: https://github.com/panates/postgrejs/actions/workflows/test.yml
|
|
205
205
|
[coveralls-image]: https://img.shields.io/coveralls/panates/postgrejs/master.svg
|
|
206
206
|
[coveralls-url]: https://coveralls.io/r/panates/postgrejs
|
|
207
207
|
[downloads-image]: https://img.shields.io/npm/dm/postgrejs.svg
|
|
@@ -269,10 +269,15 @@ class Connection extends safe_event_emitter_js_1.SafeEventEmitter {
|
|
|
269
269
|
const stack = new Error().stack;
|
|
270
270
|
return promise.catch(e => {
|
|
271
271
|
if (e instanceof Error && stack) {
|
|
272
|
-
e.stack
|
|
273
|
-
.
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
if (e.stack && stack) {
|
|
273
|
+
e.stack =
|
|
274
|
+
e.stack.substring(0, e.stack.indexOf('\n')) +
|
|
275
|
+
'\n' +
|
|
276
|
+
stack
|
|
277
|
+
.split('\n')
|
|
278
|
+
.filter((x, i) => i && !x.includes('._captureErrorStack'))
|
|
279
|
+
.join('\n');
|
|
280
|
+
}
|
|
276
281
|
}
|
|
277
282
|
throw e;
|
|
278
283
|
});
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PgSocket = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const node_crypto_1 = tslib_1.__importDefault(require("node:crypto"));
|
|
6
|
+
const node_net_1 = tslib_1.__importDefault(require("node:net"));
|
|
7
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
8
|
+
const node_tls_1 = tslib_1.__importDefault(require("node:tls"));
|
|
7
9
|
const putil_promisify_1 = tslib_1.__importDefault(require("putil-promisify"));
|
|
8
|
-
const tls_1 = tslib_1.__importDefault(require("tls"));
|
|
9
10
|
const constants_js_1 = require("../constants.js");
|
|
10
11
|
const safe_event_emitter_js_1 = require("../safe-event-emitter.js");
|
|
11
12
|
const backend_js_1 = require("./backend.js");
|
|
@@ -44,7 +45,7 @@ class PgSocket extends safe_event_emitter_js_1.SafeEventEmitter {
|
|
|
44
45
|
return;
|
|
45
46
|
this._state = constants_js_1.ConnectionState.CONNECTING;
|
|
46
47
|
const options = this.options;
|
|
47
|
-
const socket = (this._socket = new
|
|
48
|
+
const socket = (this._socket = new node_net_1.default.Socket());
|
|
48
49
|
const errorHandler = (err) => {
|
|
49
50
|
this._state = constants_js_1.ConnectionState.CLOSED;
|
|
50
51
|
this._removeListeners();
|
|
@@ -62,9 +63,9 @@ class PgSocket extends safe_event_emitter_js_1.SafeEventEmitter {
|
|
|
62
63
|
this._removeListeners();
|
|
63
64
|
if (x.toString() === 'S') {
|
|
64
65
|
const tslOptions = { ...options.ssl, socket };
|
|
65
|
-
if (options.host &&
|
|
66
|
+
if (options.host && node_net_1.default.isIP(options.host) === 0)
|
|
66
67
|
tslOptions.servername = options.host;
|
|
67
|
-
const tlsSocket = (this._socket =
|
|
68
|
+
const tlsSocket = (this._socket = node_tls_1.default.connect(tslOptions));
|
|
68
69
|
tlsSocket.once('error', errorHandler);
|
|
69
70
|
tlsSocket.once('secureConnect', () => {
|
|
70
71
|
this._removeListeners();
|
|
@@ -88,8 +89,10 @@ class PgSocket extends safe_event_emitter_js_1.SafeEventEmitter {
|
|
|
88
89
|
socket.once('error', errorHandler);
|
|
89
90
|
socket.once('connect', connectHandler);
|
|
90
91
|
this.emit('connecting');
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
const port = options.port || DEFAULT_PORT_NUMBER;
|
|
93
|
+
if (options.host && options.host.startsWith('/')) {
|
|
94
|
+
socket.connect(node_path_1.default.join(options.host, '/.s.PGSQL.' + port));
|
|
95
|
+
}
|
|
93
96
|
else
|
|
94
97
|
socket.connect(options.port || DEFAULT_PORT_NUMBER, options.host || 'localhost');
|
|
95
98
|
}
|
|
@@ -293,7 +296,7 @@ class PgSocket extends safe_event_emitter_js_1.SafeEventEmitter {
|
|
|
293
296
|
break;
|
|
294
297
|
case protocol_js_1.Protocol.AuthenticationMessageKind.MD5Password:
|
|
295
298
|
this._resolvePassword(password => {
|
|
296
|
-
const md5 = (x) =>
|
|
299
|
+
const md5 = (x) => node_crypto_1.default.createHash('md5').update(x, 'utf8').digest('hex');
|
|
297
300
|
const l = md5(password + this.options.user);
|
|
298
301
|
const r = md5(Buffer.concat([Buffer.from(l), msg.salt]));
|
|
299
302
|
const pass = 'md5' + r;
|
|
@@ -266,10 +266,15 @@ export class Connection extends SafeEventEmitter {
|
|
|
266
266
|
const stack = new Error().stack;
|
|
267
267
|
return promise.catch(e => {
|
|
268
268
|
if (e instanceof Error && stack) {
|
|
269
|
-
e.stack
|
|
270
|
-
.
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
if (e.stack && stack) {
|
|
270
|
+
e.stack =
|
|
271
|
+
e.stack.substring(0, e.stack.indexOf('\n')) +
|
|
272
|
+
'\n' +
|
|
273
|
+
stack
|
|
274
|
+
.split('\n')
|
|
275
|
+
.filter((x, i) => i && !x.includes('._captureErrorStack'))
|
|
276
|
+
.join('\n');
|
|
277
|
+
}
|
|
273
278
|
}
|
|
274
279
|
throw e;
|
|
275
280
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
import net from 'net';
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import net from 'node:net';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import tls from 'node:tls';
|
|
3
5
|
import promisify from 'putil-promisify';
|
|
4
|
-
import tls from 'tls';
|
|
5
6
|
import { ConnectionState } from '../constants.js';
|
|
6
7
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
7
8
|
import { Backend } from './backend.js';
|
|
@@ -84,8 +85,10 @@ export class PgSocket extends SafeEventEmitter {
|
|
|
84
85
|
socket.once('error', errorHandler);
|
|
85
86
|
socket.once('connect', connectHandler);
|
|
86
87
|
this.emit('connecting');
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
const port = options.port || DEFAULT_PORT_NUMBER;
|
|
89
|
+
if (options.host && options.host.startsWith('/')) {
|
|
90
|
+
socket.connect(path.join(options.host, '/.s.PGSQL.' + port));
|
|
91
|
+
}
|
|
89
92
|
else
|
|
90
93
|
socket.connect(options.port || DEFAULT_PORT_NUMBER, options.host || 'localhost');
|
|
91
94
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ConnectionState } from '../constants.js';
|
|
2
|
-
import { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
3
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
4
|
-
import { QueryResult } from '../interfaces/query-result.js';
|
|
5
|
-
import { ScriptExecuteOptions } from '../interfaces/script-execute-options.js';
|
|
6
|
-
import { ScriptResult } from '../interfaces/script-result.js';
|
|
7
|
-
import { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
8
|
-
import { DatabaseError } from '../protocol/database-error.js';
|
|
9
|
-
import { Protocol } from '../protocol/protocol.js';
|
|
2
|
+
import type { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
3
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
4
|
+
import type { QueryResult } from '../interfaces/query-result.js';
|
|
5
|
+
import type { ScriptExecuteOptions } from '../interfaces/script-execute-options.js';
|
|
6
|
+
import type { ScriptResult } from '../interfaces/script-result.js';
|
|
7
|
+
import type { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
8
|
+
import type { DatabaseError } from '../protocol/database-error.js';
|
|
9
|
+
import type { Protocol } from '../protocol/protocol.js';
|
|
10
10
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
11
|
-
import { Maybe } from '../types.js';
|
|
11
|
+
import type { Maybe } from '../types.js';
|
|
12
12
|
import { IntlConnection } from './intl-connection.js';
|
|
13
13
|
import type { Pool } from './pool.js';
|
|
14
14
|
import { PreparedStatement } from './prepared-statement.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FieldInfo } from '../interfaces/field-info.js';
|
|
2
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
1
|
+
import type { FieldInfo } from '../interfaces/field-info.js';
|
|
2
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
3
3
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
4
|
-
import { AnyParseFunction, Maybe, Row } from '../types.js';
|
|
5
|
-
import { Portal } from './portal.js';
|
|
6
|
-
import { PreparedStatement } from './prepared-statement.js';
|
|
4
|
+
import type { AnyParseFunction, Maybe, Row } from '../types.js';
|
|
5
|
+
import type { Portal } from './portal.js';
|
|
6
|
+
import type { PreparedStatement } from './prepared-statement.js';
|
|
7
7
|
export declare class Cursor extends SafeEventEmitter implements AsyncDisposable {
|
|
8
8
|
private readonly _statement;
|
|
9
9
|
private readonly _portal;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Pool as LightningPool } from 'lightning-pool';
|
|
2
|
-
import { PoolConfiguration } from '../interfaces/database-connection-params.js';
|
|
3
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
4
|
-
import { QueryResult } from '../interfaces/query-result.js';
|
|
5
|
-
import { ScriptExecuteOptions } from '../interfaces/script-execute-options.js';
|
|
6
|
-
import { ScriptResult } from '../interfaces/script-result.js';
|
|
7
|
-
import { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
2
|
+
import type { PoolConfiguration } from '../interfaces/database-connection-params.js';
|
|
3
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
4
|
+
import type { QueryResult } from '../interfaces/query-result.js';
|
|
5
|
+
import type { ScriptExecuteOptions } from '../interfaces/script-execute-options.js';
|
|
6
|
+
import type { ScriptResult } from '../interfaces/script-result.js';
|
|
7
|
+
import type { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
8
8
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
9
|
-
import { Connection, NotificationCallback } from './connection.js';
|
|
9
|
+
import { Connection, type NotificationCallback } from './connection.js';
|
|
10
10
|
import { IntlConnection } from './intl-connection.js';
|
|
11
|
-
import { PreparedStatement } from './prepared-statement.js';
|
|
11
|
+
import type { PreparedStatement } from './prepared-statement.js';
|
|
12
12
|
export declare class Pool extends SafeEventEmitter {
|
|
13
13
|
protected readonly _pool: LightningPool<IntlConnection>;
|
|
14
14
|
protected readonly _notificationListeners: SafeEventEmitter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
1
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
2
2
|
import { Protocol } from '../protocol/protocol.js';
|
|
3
|
-
import { Maybe } from '../types.js';
|
|
4
|
-
import { Connection } from './connection.js';
|
|
3
|
+
import type { Maybe } from '../types.js';
|
|
4
|
+
import type { Connection } from './connection.js';
|
|
5
5
|
import type { PreparedStatement } from './prepared-statement.js';
|
|
6
6
|
export interface PortalExecuteResult {
|
|
7
7
|
code: Protocol.BackendMessageCode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
2
|
-
import { QueryResult } from '../interfaces/query-result.js';
|
|
3
|
-
import { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
1
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
2
|
+
import type { QueryResult } from '../interfaces/query-result.js';
|
|
3
|
+
import type { StatementPrepareOptions } from '../interfaces/statement-prepare-options.js';
|
|
4
4
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
5
|
-
import { Maybe, OID } from '../types.js';
|
|
6
|
-
import { Connection } from './connection.js';
|
|
5
|
+
import type { Maybe, OID } from '../types.js';
|
|
6
|
+
import type { Connection } from './connection.js';
|
|
7
7
|
export declare class PreparedStatement extends SafeEventEmitter implements AsyncDisposable {
|
|
8
8
|
private readonly _connection;
|
|
9
9
|
private readonly _sql;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { DecodeBinaryFunction, EncodeAsNullFunction, EncodeBinaryFunction, EncodeTextFunction, OID, ParseTextFunction } from '../types.js';
|
|
2
|
-
import { EncodeCalculateDimFunction } from '../types.js';
|
|
1
|
+
import type { DecodeBinaryFunction, EncodeAsNullFunction, EncodeBinaryFunction, EncodeCalculateDimFunction, EncodeTextFunction, OID, ParseTextFunction } from '../types.js';
|
|
3
2
|
export interface DataType {
|
|
4
3
|
oid: OID;
|
|
5
4
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataTypeMap } from '../data-type-map.js';
|
|
2
|
-
import { QueryOptions } from '../interfaces/query-options.js';
|
|
3
|
-
import { Maybe, OID } from '../types.js';
|
|
4
|
-
import { SASL } from './sasl.js';
|
|
5
|
-
import { SmartBufferConfig } from './smart-buffer.js';
|
|
2
|
+
import type { QueryOptions } from '../interfaces/query-options.js';
|
|
3
|
+
import type { Maybe, OID } from '../types.js';
|
|
4
|
+
import type { SASL } from './sasl.js';
|
|
5
|
+
import { type SmartBufferConfig } from './smart-buffer.js';
|
|
6
6
|
export interface FrontendOptions {
|
|
7
7
|
buffer?: SmartBufferConfig;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionState } from '../constants.js';
|
|
2
|
-
import { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
2
|
+
import type { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
3
3
|
import { SafeEventEmitter } from '../safe-event-emitter.js';
|
|
4
|
-
import { Callback, Maybe } from '../types.js';
|
|
4
|
+
import type { Callback, Maybe } from '../types.js';
|
|
5
5
|
import { Frontend } from './frontend.js';
|
|
6
6
|
import { Protocol } from './protocol.js';
|
|
7
7
|
export type CaptureCallback = (code: Protocol.BackendMessageCode, msg: any, done: (err: Maybe<Error>, result?: any) => void) => void | Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
1
|
+
import type { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
2
2
|
export declare function configFromEnv(): ConnectionConfiguration;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldInfo } from '../interfaces/field-info.js';
|
|
1
|
+
import type { FieldInfo } from '../interfaces/field-info.js';
|
|
2
2
|
export declare function convertRowToObject(fields: FieldInfo[], row: any[]): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
1
|
+
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
2
|
import type { DecodeBinaryFunction, Nullable } from '../types.js';
|
|
3
3
|
export declare function decodeBinaryArray<T = any>(buf: Buffer, decoder: DecodeBinaryFunction, options?: DataMappingOptions): Nullable<T[]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
2
|
import type { SmartBuffer } from '../protocol/smart-buffer.js';
|
|
3
|
-
import type { EncodeBinaryFunction, OID } from '../types.js';
|
|
4
|
-
import { EncodeCalculateDimFunction } from '../types.js';
|
|
3
|
+
import type { EncodeBinaryFunction, EncodeCalculateDimFunction, OID } from '../types.js';
|
|
5
4
|
export declare function encodeBinaryArray(io: SmartBuffer, value: any[], itemOid: OID, options: DataMappingOptions, encode: EncodeBinaryFunction, encodeCalculateDimFn?: EncodeCalculateDimFunction): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTypeMap } from '../data-type-map.js';
|
|
2
|
-
import { Protocol } from '../protocol/protocol.js';
|
|
3
|
-
import { AnyParseFunction } from '../types.js';
|
|
1
|
+
import type { DataTypeMap } from '../data-type-map.js';
|
|
2
|
+
import type { Protocol } from '../protocol/protocol.js';
|
|
3
|
+
import type { AnyParseFunction } from '../types.js';
|
|
4
4
|
export declare function getParsers(typeMap: DataTypeMap, fields: Protocol.RowDescription[]): AnyParseFunction[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
-
import { AnyParseFunction } from '../types.js';
|
|
1
|
+
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
+
import type { AnyParseFunction } from '../types.js';
|
|
3
3
|
export declare function parseRow(parsers: AnyParseFunction[], row: any[], options: DataMappingOptions): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
-
import { EncodeTextFunction } from '../types.js';
|
|
1
|
+
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
+
import type { EncodeTextFunction } from '../types.js';
|
|
3
3
|
export declare function stringifyArrayLiteral(value: any[], options?: DataMappingOptions, encode?: EncodeTextFunction): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
-
import { EncodeTextFunction } from '../types.js';
|
|
1
|
+
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
+
import type { EncodeTextFunction } from '../types.js';
|
|
3
3
|
export declare function stringifyArrayForSQL(v: any[], options?: DataMappingOptions, encode?: EncodeTextFunction): string;
|
|
4
4
|
export declare function stringifyValueForSQL(v: any, options?: DataMappingOptions, encode?: EncodeTextFunction): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataFormat } from '../constants.js';
|
|
2
|
-
import { DataTypeMap } from '../data-type-map.js';
|
|
3
|
-
import { FieldInfo } from '../interfaces/field-info.js';
|
|
4
|
-
import { Protocol } from '../protocol/protocol.js';
|
|
2
|
+
import type { DataTypeMap } from '../data-type-map.js';
|
|
3
|
+
import type { FieldInfo } from '../interfaces/field-info.js';
|
|
4
|
+
import type { Protocol } from '../protocol/protocol.js';
|
|
5
5
|
export declare function wrapRowDescription(typeMap: DataTypeMap, fields: Protocol.RowDescription[], columnFormat: DataFormat | DataFormat[]): FieldInfo[];
|