postgrejs 2.12.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/CHANGELOG.md +814 -0
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/cjs/connection/bind-param.js +10 -0
- package/cjs/connection/connection.js +279 -0
- package/cjs/connection/cursor.js +93 -0
- package/cjs/connection/intl-connection.js +243 -0
- package/cjs/connection/pool.js +226 -0
- package/cjs/connection/portal.js +148 -0
- package/cjs/connection/prepared-statement.js +217 -0
- package/cjs/constants.js +250 -0
- package/cjs/data-type-map.js +119 -0
- package/cjs/data-types/bool-type.js +27 -0
- package/cjs/data-types/box-type.js +52 -0
- package/cjs/data-types/bytea-type.js +29 -0
- package/cjs/data-types/char-type.js +27 -0
- package/cjs/data-types/circle-type.js +48 -0
- package/cjs/data-types/date-type.js +67 -0
- package/cjs/data-types/float4-type.js +25 -0
- package/cjs/data-types/float8-type.js +25 -0
- package/cjs/data-types/int2-type.js +26 -0
- package/cjs/data-types/int2-vector-type.js +38 -0
- package/cjs/data-types/int4-type.js +26 -0
- package/cjs/data-types/int8-type.js +31 -0
- package/cjs/data-types/json-type.js +38 -0
- package/cjs/data-types/jsonb-type.js +42 -0
- package/cjs/data-types/lseg-type.js +52 -0
- package/cjs/data-types/numeric-type.js +125 -0
- package/cjs/data-types/oid-type.js +32 -0
- package/cjs/data-types/point-type.js +39 -0
- package/cjs/data-types/time-type.js +54 -0
- package/cjs/data-types/timestamp-type.js +81 -0
- package/cjs/data-types/timestamptz-type.js +73 -0
- package/cjs/data-types/uuid-type.js +39 -0
- package/cjs/data-types/varchar-type.js +27 -0
- package/cjs/index.js +41 -0
- package/cjs/interfaces/command-result.js +2 -0
- package/cjs/interfaces/data-mapping-options.js +2 -0
- package/cjs/interfaces/data-type.js +2 -0
- package/cjs/interfaces/database-connection-params.js +2 -0
- package/cjs/interfaces/field-info.js +2 -0
- package/cjs/interfaces/query-options.js +2 -0
- package/cjs/interfaces/query-result.js +2 -0
- package/cjs/interfaces/script-execute-options.js +2 -0
- package/cjs/interfaces/script-result.js +2 -0
- package/cjs/interfaces/statement-prepare-options.js +2 -0
- package/cjs/package.json +3 -0
- package/cjs/protocol/backend.js +256 -0
- package/cjs/protocol/buffer-reader.js +78 -0
- package/cjs/protocol/database-error.js +17 -0
- package/cjs/protocol/frontend.js +218 -0
- package/cjs/protocol/pg-socket.js +345 -0
- package/cjs/protocol/protocol.js +71 -0
- package/cjs/protocol/sasl.js +108 -0
- package/cjs/protocol/smart-buffer.js +195 -0
- package/cjs/safe-event-emitter.js +17 -0
- package/cjs/types.js +2 -0
- package/cjs/util/array-calculatedim.js +19 -0
- package/cjs/util/bigint-methods.js +42 -0
- package/cjs/util/config-from-env.js +30 -0
- package/cjs/util/connection-config.js +65 -0
- package/cjs/util/convert-row-to-object.js +13 -0
- package/cjs/util/decode-binaryarray.js +39 -0
- package/cjs/util/encode-binaryarray.js +45 -0
- package/cjs/util/escape-literal.js +27 -0
- package/cjs/util/fast-parseint.js +32 -0
- package/cjs/util/get-parsers.js +42 -0
- package/cjs/util/parse-array.js +61 -0
- package/cjs/util/parse-datetime.js +38 -0
- package/cjs/util/parse-row.js +11 -0
- package/cjs/util/parse-time.js +29 -0
- package/cjs/util/stringify-arrayliteral.js +38 -0
- package/cjs/util/stringify-for-sql.js +30 -0
- package/cjs/util/wrap-row-description.js +35 -0
- package/esm/connection/bind-param.js +6 -0
- package/esm/connection/connection.js +275 -0
- package/esm/connection/cursor.js +86 -0
- package/esm/connection/intl-connection.js +238 -0
- package/esm/connection/pool.js +222 -0
- package/esm/connection/portal.js +144 -0
- package/esm/connection/prepared-statement.js +213 -0
- package/esm/constants.js +247 -0
- package/esm/data-type-map.js +115 -0
- package/esm/data-types/bool-type.js +24 -0
- package/esm/data-types/box-type.js +49 -0
- package/esm/data-types/bytea-type.js +23 -0
- package/esm/data-types/char-type.js +24 -0
- package/esm/data-types/circle-type.js +45 -0
- package/esm/data-types/date-type.js +64 -0
- package/esm/data-types/float4-type.js +22 -0
- package/esm/data-types/float8-type.js +22 -0
- package/esm/data-types/int2-type.js +23 -0
- package/esm/data-types/int2-vector-type.js +35 -0
- package/esm/data-types/int4-type.js +23 -0
- package/esm/data-types/int8-type.js +28 -0
- package/esm/data-types/json-type.js +35 -0
- package/esm/data-types/jsonb-type.js +39 -0
- package/esm/data-types/lseg-type.js +49 -0
- package/esm/data-types/numeric-type.js +121 -0
- package/esm/data-types/oid-type.js +29 -0
- package/esm/data-types/point-type.js +36 -0
- package/esm/data-types/time-type.js +51 -0
- package/esm/data-types/timestamp-type.js +78 -0
- package/esm/data-types/timestamptz-type.js +70 -0
- package/esm/data-types/uuid-type.js +36 -0
- package/esm/data-types/varchar-type.js +24 -0
- package/esm/index.js +25 -0
- package/esm/interfaces/command-result.js +1 -0
- package/esm/interfaces/data-mapping-options.js +1 -0
- package/esm/interfaces/data-type.js +1 -0
- package/esm/interfaces/database-connection-params.js +1 -0
- package/esm/interfaces/field-info.js +1 -0
- package/esm/interfaces/query-options.js +1 -0
- package/esm/interfaces/query-result.js +1 -0
- package/esm/interfaces/script-execute-options.js +1 -0
- package/esm/interfaces/script-result.js +1 -0
- package/esm/interfaces/statement-prepare-options.js +1 -0
- package/esm/protocol/backend.js +252 -0
- package/esm/protocol/buffer-reader.js +74 -0
- package/esm/protocol/database-error.js +13 -0
- package/esm/protocol/frontend.js +214 -0
- package/esm/protocol/pg-socket.js +338 -0
- package/esm/protocol/protocol.js +68 -0
- package/esm/protocol/sasl.js +102 -0
- package/esm/protocol/smart-buffer.js +168 -0
- package/esm/safe-event-emitter.js +13 -0
- package/esm/types.js +1 -0
- package/esm/util/array-calculatedim.js +15 -0
- package/esm/util/bigint-methods.js +37 -0
- package/esm/util/config-from-env.js +26 -0
- package/esm/util/connection-config.js +57 -0
- package/esm/util/convert-row-to-object.js +9 -0
- package/esm/util/decode-binaryarray.js +35 -0
- package/esm/util/encode-binaryarray.js +41 -0
- package/esm/util/escape-literal.js +23 -0
- package/esm/util/fast-parseint.js +28 -0
- package/esm/util/get-parsers.js +38 -0
- package/esm/util/parse-array.js +57 -0
- package/esm/util/parse-datetime.js +34 -0
- package/esm/util/parse-row.js +7 -0
- package/esm/util/parse-time.js +25 -0
- package/esm/util/stringify-arrayliteral.js +34 -0
- package/esm/util/stringify-for-sql.js +25 -0
- package/esm/util/wrap-row-description.js +31 -0
- package/package.json +54 -0
- package/typings/connection/bind-param.d.ts +6 -0
- package/typings/connection/connection.d.ts +110 -0
- package/typings/connection/cursor.d.ts +25 -0
- package/typings/connection/intl-connection.d.ts +40 -0
- package/typings/connection/pool.d.ts +52 -0
- package/typings/connection/portal.d.ts +23 -0
- package/typings/connection/prepared-statement.d.ts +27 -0
- package/typings/constants.d.ts +130 -0
- package/typings/data-type-map.d.ts +11 -0
- package/typings/data-types/bool-type.d.ts +3 -0
- package/typings/data-types/box-type.d.ts +3 -0
- package/typings/data-types/bytea-type.d.ts +3 -0
- package/typings/data-types/char-type.d.ts +3 -0
- package/typings/data-types/circle-type.d.ts +3 -0
- package/typings/data-types/date-type.d.ts +3 -0
- package/typings/data-types/float4-type.d.ts +3 -0
- package/typings/data-types/float8-type.d.ts +3 -0
- package/typings/data-types/int2-type.d.ts +3 -0
- package/typings/data-types/int2-vector-type.d.ts +3 -0
- package/typings/data-types/int4-type.d.ts +3 -0
- package/typings/data-types/int8-type.d.ts +3 -0
- package/typings/data-types/json-type.d.ts +3 -0
- package/typings/data-types/jsonb-type.d.ts +3 -0
- package/typings/data-types/lseg-type.d.ts +3 -0
- package/typings/data-types/numeric-type.d.ts +12 -0
- package/typings/data-types/oid-type.d.ts +4 -0
- package/typings/data-types/point-type.d.ts +3 -0
- package/typings/data-types/time-type.d.ts +3 -0
- package/typings/data-types/timestamp-type.d.ts +3 -0
- package/typings/data-types/timestamptz-type.d.ts +3 -0
- package/typings/data-types/uuid-type.d.ts +3 -0
- package/typings/data-types/varchar-type.d.ts +3 -0
- package/typings/index.d.ts +25 -0
- package/typings/interfaces/command-result.d.ts +28 -0
- package/typings/interfaces/data-mapping-options.d.ts +9 -0
- package/typings/interfaces/data-type.d.ts +31 -0
- package/typings/interfaces/database-connection-params.d.ts +38 -0
- package/typings/interfaces/field-info.d.ts +46 -0
- package/typings/interfaces/query-options.d.ts +46 -0
- package/typings/interfaces/query-result.d.ts +8 -0
- package/typings/interfaces/script-execute-options.d.ts +26 -0
- package/typings/interfaces/script-result.d.ts +15 -0
- package/typings/interfaces/statement-prepare-options.d.ts +13 -0
- package/typings/protocol/backend.d.ts +9 -0
- package/typings/protocol/buffer-reader.d.ts +18 -0
- package/typings/protocol/database-error.d.ts +20 -0
- package/typings/protocol/frontend.d.ts +59 -0
- package/typings/protocol/pg-socket.d.ts +51 -0
- package/typings/protocol/protocol.d.ts +180 -0
- package/typings/protocol/sasl.d.ts +13 -0
- package/typings/protocol/smart-buffer.d.ts +39 -0
- package/typings/safe-event-emitter.d.ts +5 -0
- package/typings/types.d.ts +15 -0
- package/typings/util/array-calculatedim.d.ts +1 -0
- package/typings/util/bigint-methods.d.ts +3 -0
- package/typings/util/config-from-env.d.ts +2 -0
- package/typings/util/connection-config.d.ts +3 -0
- package/typings/util/convert-row-to-object.d.ts +2 -0
- package/typings/util/decode-binaryarray.d.ts +4 -0
- package/typings/util/encode-binaryarray.d.ts +5 -0
- package/typings/util/escape-literal.d.ts +1 -0
- package/typings/util/fast-parseint.d.ts +1 -0
- package/typings/util/get-parsers.d.ts +4 -0
- package/typings/util/parse-array.d.ts +5 -0
- package/typings/util/parse-datetime.d.ts +1 -0
- package/typings/util/parse-row.d.ts +3 -0
- package/typings/util/parse-time.d.ts +3 -0
- package/typings/util/stringify-arrayliteral.d.ts +3 -0
- package/typings/util/stringify-for-sql.d.ts +4 -0
- package/typings/util/wrap-row-description.d.ts +5 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Nullable } from '../types.js';
|
|
3
|
+
export declare namespace Protocol {
|
|
4
|
+
const VERSION_MAJOR = 3;
|
|
5
|
+
const VERSION_MINOR = 0;
|
|
6
|
+
enum BackendMessageCode {
|
|
7
|
+
Authentication = 82,// R
|
|
8
|
+
BackendKeyData = 75,// K
|
|
9
|
+
BindComplete = 50,// 2
|
|
10
|
+
CloseComplete = 51,// 3
|
|
11
|
+
CommandComplete = 67,// C
|
|
12
|
+
CopyData = 100,// d
|
|
13
|
+
CopyDone = 99,// c
|
|
14
|
+
CopyInResponse = 103,// G
|
|
15
|
+
CopyOutResponse = 72,// H
|
|
16
|
+
CopyBothResponse = 87,// W
|
|
17
|
+
DataRow = 68,// D
|
|
18
|
+
EmptyQueryResponse = 73,// I
|
|
19
|
+
ErrorResponse = 69,// E
|
|
20
|
+
FunctionCallResponse = 86,// V
|
|
21
|
+
NegotiateProtocolVersion = 118,// v
|
|
22
|
+
NoData = 110,// n
|
|
23
|
+
NoticeResponse = 78,// N
|
|
24
|
+
NotificationResponse = 65,// A
|
|
25
|
+
ParameterDescription = 116,// t
|
|
26
|
+
ParameterStatus = 83,// S
|
|
27
|
+
ParseComplete = 49,// 1
|
|
28
|
+
PortalSuspended = 115,// s
|
|
29
|
+
ReadyForQuery = 90,// Z
|
|
30
|
+
RowDescription = 84
|
|
31
|
+
}
|
|
32
|
+
enum FrontendMessageCode {
|
|
33
|
+
Bind = 66,// R
|
|
34
|
+
Close = 67,// C
|
|
35
|
+
CopyData = 100,// d
|
|
36
|
+
CopyDone = 99,// c
|
|
37
|
+
CopyFail = 102,// f
|
|
38
|
+
Describe = 68,// D
|
|
39
|
+
Execute = 69,// E
|
|
40
|
+
Flush = 72,// H
|
|
41
|
+
FunctionCall = 70,// F
|
|
42
|
+
Parse = 80,// P
|
|
43
|
+
PasswordMessage = 112,// p
|
|
44
|
+
Query = 81,// Q
|
|
45
|
+
Sync = 83,// S
|
|
46
|
+
Terminate = 88
|
|
47
|
+
}
|
|
48
|
+
enum AuthenticationMessageKind {
|
|
49
|
+
KerberosV5 = "KerberosV5",
|
|
50
|
+
CleartextPassword = "CleartextPassword",
|
|
51
|
+
MD5Password = "MD5Password",
|
|
52
|
+
SCMCredential = "SCMCredential",
|
|
53
|
+
GSS = "GSS",
|
|
54
|
+
SSPI = "SSPI",
|
|
55
|
+
GSSContinue = "GSSContinue",
|
|
56
|
+
SASL = "SASL",
|
|
57
|
+
SASLContinue = "SASLContinue",
|
|
58
|
+
SASLFinal = "SASLFinal"
|
|
59
|
+
}
|
|
60
|
+
enum DataFormat {
|
|
61
|
+
text = 0,
|
|
62
|
+
binary = 1
|
|
63
|
+
}
|
|
64
|
+
interface AuthenticationRequiredMessage {
|
|
65
|
+
kind: AuthenticationMessageKind;
|
|
66
|
+
}
|
|
67
|
+
interface AuthenticationKerberosV5Message extends AuthenticationRequiredMessage {
|
|
68
|
+
kind: AuthenticationMessageKind.KerberosV5;
|
|
69
|
+
}
|
|
70
|
+
interface AuthenticationCleartextPasswordMessage extends AuthenticationRequiredMessage {
|
|
71
|
+
kind: AuthenticationMessageKind.CleartextPassword;
|
|
72
|
+
}
|
|
73
|
+
interface AuthenticationMD5PasswordMessage extends AuthenticationRequiredMessage {
|
|
74
|
+
kind: AuthenticationMessageKind.MD5Password;
|
|
75
|
+
salt: Buffer;
|
|
76
|
+
}
|
|
77
|
+
interface AuthenticationSCMCredentialMessage extends AuthenticationRequiredMessage {
|
|
78
|
+
kind: AuthenticationMessageKind.SCMCredential;
|
|
79
|
+
}
|
|
80
|
+
interface AuthenticationGSSMessage extends AuthenticationRequiredMessage {
|
|
81
|
+
kind: AuthenticationMessageKind.GSS;
|
|
82
|
+
}
|
|
83
|
+
interface AuthenticationSSPIMessage extends AuthenticationRequiredMessage {
|
|
84
|
+
kind: AuthenticationMessageKind.SSPI;
|
|
85
|
+
}
|
|
86
|
+
interface AuthenticationGSSContinueMessage extends AuthenticationRequiredMessage {
|
|
87
|
+
kind: AuthenticationMessageKind.GSSContinue;
|
|
88
|
+
data: Buffer;
|
|
89
|
+
}
|
|
90
|
+
interface AuthenticationSASLMessage extends AuthenticationRequiredMessage {
|
|
91
|
+
kind: AuthenticationMessageKind.SASL;
|
|
92
|
+
mechanisms: string[];
|
|
93
|
+
}
|
|
94
|
+
interface AuthenticationSASLContinueMessage extends AuthenticationRequiredMessage {
|
|
95
|
+
kind: AuthenticationMessageKind.SASLContinue;
|
|
96
|
+
data: string;
|
|
97
|
+
}
|
|
98
|
+
interface AuthenticationSASLFinalMessage extends AuthenticationRequiredMessage {
|
|
99
|
+
kind: AuthenticationMessageKind.SASLFinal;
|
|
100
|
+
data: string;
|
|
101
|
+
}
|
|
102
|
+
interface BackendKeyDataMessage {
|
|
103
|
+
processID: number;
|
|
104
|
+
secretKey: number;
|
|
105
|
+
}
|
|
106
|
+
interface CommandCompleteMessage {
|
|
107
|
+
command: string;
|
|
108
|
+
oid?: number;
|
|
109
|
+
rowCount?: number;
|
|
110
|
+
}
|
|
111
|
+
interface CopyDataMessage {
|
|
112
|
+
data: Buffer;
|
|
113
|
+
}
|
|
114
|
+
interface CopyResponseMessage {
|
|
115
|
+
overallFormat: DataFormat;
|
|
116
|
+
columnCount: number;
|
|
117
|
+
columnFormats?: DataFormat[];
|
|
118
|
+
}
|
|
119
|
+
interface DataRow {
|
|
120
|
+
}
|
|
121
|
+
interface DataRowMessage {
|
|
122
|
+
columnCount: number;
|
|
123
|
+
columns: Nullable<Buffer>[];
|
|
124
|
+
}
|
|
125
|
+
interface ErrorResponseMessage {
|
|
126
|
+
severity?: string;
|
|
127
|
+
code?: string;
|
|
128
|
+
message?: string;
|
|
129
|
+
detail?: string;
|
|
130
|
+
hint?: string;
|
|
131
|
+
position?: string;
|
|
132
|
+
internalPosition?: string;
|
|
133
|
+
internalQuery?: string;
|
|
134
|
+
where?: string;
|
|
135
|
+
schema?: string;
|
|
136
|
+
table?: string;
|
|
137
|
+
column?: string;
|
|
138
|
+
dataType?: string;
|
|
139
|
+
constraint?: string;
|
|
140
|
+
file?: string;
|
|
141
|
+
line?: string;
|
|
142
|
+
routine?: string;
|
|
143
|
+
}
|
|
144
|
+
interface NotificationResponseMessage {
|
|
145
|
+
processId: number;
|
|
146
|
+
channel: string;
|
|
147
|
+
payload: string;
|
|
148
|
+
}
|
|
149
|
+
interface FunctionCallResponseMessage {
|
|
150
|
+
result: Buffer;
|
|
151
|
+
}
|
|
152
|
+
interface NegotiateProtocolVersionMessage {
|
|
153
|
+
supportedVersionMinor: number;
|
|
154
|
+
numberOfNotSupportedVersions: number;
|
|
155
|
+
option: string;
|
|
156
|
+
}
|
|
157
|
+
interface ParameterDescriptionMessage {
|
|
158
|
+
parameterCount: number;
|
|
159
|
+
parameterIds: number[];
|
|
160
|
+
}
|
|
161
|
+
interface ParameterStatusMessage {
|
|
162
|
+
name: string;
|
|
163
|
+
value: string;
|
|
164
|
+
}
|
|
165
|
+
interface ReadyForQueryMessage {
|
|
166
|
+
status: string;
|
|
167
|
+
}
|
|
168
|
+
interface RowDescription {
|
|
169
|
+
fieldName: string;
|
|
170
|
+
tableId: number;
|
|
171
|
+
columnId: number;
|
|
172
|
+
dataTypeId: number;
|
|
173
|
+
fixedSize?: number;
|
|
174
|
+
modifier?: number;
|
|
175
|
+
format: DataFormat;
|
|
176
|
+
}
|
|
177
|
+
interface RowDescriptionMessage {
|
|
178
|
+
fields: RowDescription[];
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare namespace SASL {
|
|
2
|
+
interface Session {
|
|
3
|
+
username: string;
|
|
4
|
+
mechanism: string;
|
|
5
|
+
nonce: string;
|
|
6
|
+
clientFirstMessage: string;
|
|
7
|
+
clientFinalMessage: string;
|
|
8
|
+
serverSignature: string;
|
|
9
|
+
}
|
|
10
|
+
function createSession(username: string, mechanism: string): Session;
|
|
11
|
+
function continueSession(session: Session, password: string, data: string): void;
|
|
12
|
+
function finalizeSession(session: Session, data: string): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BufferReader } from './buffer-reader.js';
|
|
3
|
+
export interface SmartBufferConfig {
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
houseKeepInterval?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class SmartBuffer extends BufferReader {
|
|
9
|
+
static DEFAULT_PAGE_SIZE: number;
|
|
10
|
+
static DEFAULT_MAX_SIZE: number;
|
|
11
|
+
private readonly _houseKeepInterval;
|
|
12
|
+
private _houseKeepTimer?;
|
|
13
|
+
private _lastHouseKeep;
|
|
14
|
+
private _stMaxPages;
|
|
15
|
+
private _length;
|
|
16
|
+
readonly pageSize: number;
|
|
17
|
+
readonly maxSize: number;
|
|
18
|
+
constructor(cfg?: SmartBufferConfig);
|
|
19
|
+
get capacity(): number;
|
|
20
|
+
get length(): number;
|
|
21
|
+
start(): this;
|
|
22
|
+
flush(): Buffer;
|
|
23
|
+
growSize(len: number): this;
|
|
24
|
+
fill(value?: number, len?: number): this;
|
|
25
|
+
writeCString(str: string, encoding?: BufferEncoding): this;
|
|
26
|
+
writeLString(str?: string, encoding?: BufferEncoding): this;
|
|
27
|
+
writeString(str: string, encoding?: BufferEncoding): this;
|
|
28
|
+
writeInt8(n: number): this;
|
|
29
|
+
writeUInt8(n: number): this;
|
|
30
|
+
writeUInt16BE(n: number): this;
|
|
31
|
+
writeUInt32BE(n: number): this;
|
|
32
|
+
writeInt16BE(n: number): this;
|
|
33
|
+
writeInt32BE(n: number): this;
|
|
34
|
+
writeBigInt64BE(n: bigint | number): this;
|
|
35
|
+
writeFloatBE(n: number): this;
|
|
36
|
+
writeDoubleBE(n: number): this;
|
|
37
|
+
writeBuffer(buffer: Buffer): this;
|
|
38
|
+
private _houseKeep;
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { DataMappingOptions } from './interfaces/data-mapping-options.js';
|
|
3
|
+
import type { SmartBuffer } from './protocol/smart-buffer';
|
|
4
|
+
export type OID = number;
|
|
5
|
+
export type Maybe<T> = T | undefined;
|
|
6
|
+
export type Nullable<T> = T | null;
|
|
7
|
+
export type Row = any;
|
|
8
|
+
export type Callback = (err?: Error, value?: any) => void;
|
|
9
|
+
export type DecodeBinaryFunction = (buf: Buffer, options: DataMappingOptions & Record<string, any>) => any;
|
|
10
|
+
export type EncodeBinaryFunction = (buf: SmartBuffer, v: any, options: DataMappingOptions) => void;
|
|
11
|
+
export type EncodeCalculateDimFunction = (v: any[]) => number[];
|
|
12
|
+
export type ParseTextFunction = (v: any, options: DataMappingOptions) => any;
|
|
13
|
+
export type EncodeTextFunction = (v: any, options: DataMappingOptions) => string;
|
|
14
|
+
export type AnyParseFunction = ParseTextFunction | DecodeBinaryFunction;
|
|
15
|
+
export type DebugLogger = (namespace: string, format: any, ...args: any[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arrayCalculateDim(arr: any[]): number[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ConnectionConfiguration } from '../interfaces/database-connection-params.js';
|
|
2
|
+
export declare function getConnectionConfig(config?: ConnectionConfiguration | string): ConnectionConfiguration;
|
|
3
|
+
export declare function parseConnectionString(str: string): ConnectionConfiguration;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
3
|
+
import type { DecodeBinaryFunction, Nullable } from '../types.js';
|
|
4
|
+
export declare function decodeBinaryArray<T = any>(buf: Buffer, decoder: DecodeBinaryFunction, options?: DataMappingOptions): Nullable<T[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
+
import type { SmartBuffer } from '../protocol/smart-buffer.js';
|
|
3
|
+
import type { EncodeBinaryFunction, OID } from '../types.js';
|
|
4
|
+
import { EncodeCalculateDimFunction } from '../types.js';
|
|
5
|
+
export declare function encodeBinaryArray(io: SmartBuffer, value: any[], itemOid: OID, options: DataMappingOptions, encode: EncodeBinaryFunction, encodeCalculateDimFn?: EncodeCalculateDimFunction): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeLiteral(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fastParseInt(str: string | number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseDateTime(str: string, parseTime?: boolean, parseTimeZone?: boolean, utc?: boolean): Date | number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataMappingOptions } from '../interfaces/data-mapping-options.js';
|
|
2
|
+
import { EncodeTextFunction } from '../types.js';
|
|
3
|
+
export declare function stringifyArrayForSQL(v: any[], options?: DataMappingOptions, encode?: EncodeTextFunction): string;
|
|
4
|
+
export declare function stringifyValueForSQL(v: any, options?: DataMappingOptions, encode?: EncodeTextFunction): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
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';
|
|
5
|
+
export declare function wrapRowDescription(typeMap: DataTypeMap, fields: Protocol.RowDescription[], columnFormat: DataFormat | DataFormat[]): FieldInfo[];
|