node-firebird-driver 3.2.2 → 3.4.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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/lib/impl/attachment.d.ts +4 -4
  3. package/dist/lib/impl/attachment.js +8 -6
  4. package/dist/lib/impl/attachment.js.map +1 -1
  5. package/dist/lib/impl/blob.js.map +1 -1
  6. package/dist/lib/impl/client.js +3 -2
  7. package/dist/lib/impl/client.js.map +1 -1
  8. package/dist/lib/impl/date-time.js +2 -1
  9. package/dist/lib/impl/date-time.js.map +1 -1
  10. package/dist/lib/impl/events.js +2 -1
  11. package/dist/lib/impl/events.js.map +1 -1
  12. package/dist/lib/impl/fb-util.d.ts +2 -1
  13. package/dist/lib/impl/fb-util.js +100 -81
  14. package/dist/lib/impl/fb-util.js.map +1 -1
  15. package/dist/lib/impl/resultset.js +11 -5
  16. package/dist/lib/impl/resultset.js.map +1 -1
  17. package/dist/lib/impl/statement.d.ts +3 -1
  18. package/dist/lib/impl/statement.js +4 -2
  19. package/dist/lib/impl/statement.js.map +1 -1
  20. package/dist/lib/impl/time-zones.js +5 -3
  21. package/dist/lib/impl/time-zones.js.map +1 -1
  22. package/dist/lib/impl/transaction.js +2 -1
  23. package/dist/lib/impl/transaction.js.map +1 -1
  24. package/dist/lib/index.d.ts +27 -1
  25. package/dist/lib/index.js +25 -1
  26. package/dist/lib/index.js.map +1 -1
  27. package/dist/test/tests.js +197 -68
  28. package/dist/test/tests.js.map +1 -1
  29. package/package.json +6 -5
  30. package/src/lib/impl/attachment.ts +290 -253
  31. package/src/lib/impl/blob.ts +37 -35
  32. package/src/lib/impl/client.ts +60 -61
  33. package/src/lib/impl/date-time.ts +33 -33
  34. package/src/lib/impl/events.ts +17 -18
  35. package/src/lib/impl/fb-util.ts +552 -448
  36. package/src/lib/impl/resultset.ts +94 -86
  37. package/src/lib/impl/statement.ts +157 -127
  38. package/src/lib/impl/time-zones.ts +643 -641
  39. package/src/lib/impl/transaction.ts +37 -38
  40. package/src/lib/index.ts +331 -270
  41. package/src/test/tests.ts +1028 -860
  42. package/tsconfig.json +7 -13
package/src/lib/index.ts CHANGED
@@ -1,384 +1,445 @@
1
1
  /** Client interface. */
2
2
  export interface Client {
3
- /** Disposes this client's resources. */
4
- dispose(): Promise<void>;
3
+ /** Disposes this client's resources. */
4
+ dispose(): Promise<void>;
5
5
 
6
- /** Connects to a database. */
7
- connect(uri: string, options?: ConnectOptions): Promise<Attachment>;
6
+ /** Connects to a database. */
7
+ connect(uri: string, options?: ConnectOptions): Promise<Attachment>;
8
8
 
9
- /** Creates a database. */
10
- createDatabase(uri: string, options?: CreateDatabaseOptions): Promise<Attachment>;
9
+ /** Creates a database. */
10
+ createDatabase(uri: string, options?: CreateDatabaseOptions): Promise<Attachment>;
11
11
 
12
- /** True if the client has not been disposed. */
13
- readonly isValid: boolean;
12
+ /** True if the client has not been disposed. */
13
+ readonly isValid: boolean;
14
14
 
15
- /** Default connect options. */
16
- defaultConnectOptions?: ConnectOptions;
15
+ /** Default connect options. */
16
+ defaultConnectOptions?: ConnectOptions;
17
17
 
18
- /** Default create database options. */
19
- defaultCreateDatabaseOptions?: CreateDatabaseOptions;
18
+ /** Default create database options. */
19
+ defaultCreateDatabaseOptions?: CreateDatabaseOptions;
20
20
 
21
- /** Default transaction options. */
22
- defaultTransactionOptions?: TransactionOptions;
21
+ /** Default transaction options. */
22
+ defaultTransactionOptions?: TransactionOptions;
23
23
 
24
- /** Default query's prepare options. */
25
- defaultPrepareOptions?: PrepareOptions;
24
+ /** Default query's prepare options. */
25
+ defaultPrepareOptions?: PrepareOptions;
26
26
 
27
- /** Default query's execute options. */
28
- defaultExecuteOptions?: ExecuteOptions;
27
+ /** Default query's execute options. */
28
+ defaultExecuteOptions?: ExecuteOptions;
29
29
 
30
- /** Default query's executeQuery options. */
31
- defaultExecuteQueryOptions?: ExecuteQueryOptions;
30
+ /** Default query's executeQuery options. */
31
+ defaultExecuteQueryOptions?: ExecuteQueryOptions;
32
32
 
33
- /** Default result set's fetch options. */
34
- defaultFetchOptions?: FetchOptions;
33
+ /** Default result set's fetch options. */
34
+ defaultFetchOptions?: FetchOptions;
35
35
  }
36
36
 
37
37
  /** ConnectOptions interface. */
38
38
  export interface ConnectOptions {
39
- /** User name. */
40
- username?: string;
39
+ /** User name. */
40
+ username?: string;
41
41
 
42
- /** User password. */
43
- password?: string;
42
+ /** User password. */
43
+ password?: string;
44
44
 
45
- /** User role. */
46
- role?: string;
45
+ /** User role. */
46
+ role?: string;
47
+
48
+ /** Set database read/write mode. */
49
+ setDatabaseReadWriteMode?: DatabaseReadWriteMode;
50
+ }
51
+
52
+ /** DatabaseReadWriteMode enum */
53
+ export enum DatabaseReadWriteMode {
54
+ READ_WRITE = 'READ_WRITE',
55
+ READ_ONLY = 'READ_ONLY',
47
56
  }
48
57
 
49
58
  /** CreateDatabaseOptions interface. */
50
59
  export interface CreateDatabaseOptions extends ConnectOptions {
51
- /** Forced write. */
52
- forcedWrite?: boolean;
60
+ /** Forced write. */
61
+ forcedWrite?: boolean;
53
62
  }
54
63
 
55
64
  /** TransactionIsolation enum */
56
65
  export enum TransactionIsolation {
57
- CONSISTENCY = 'CONSISTENCY',
58
- READ_COMMITTED = 'READ_COMMITTED',
59
- SNAPSHOT = 'SNAPSHOT'
66
+ CONSISTENCY = 'CONSISTENCY',
67
+ READ_COMMITTED = 'READ_COMMITTED',
68
+ SNAPSHOT = 'SNAPSHOT',
60
69
  }
61
70
 
62
71
  /** TransactionOptions interface. */
63
72
  export interface TransactionOptions {
64
- isolation?: TransactionIsolation;
65
- readCommittedMode?: 'NO_RECORD_VERSION' | 'RECORD_VERSION';
66
- accessMode?: 'READ_ONLY' | 'READ_WRITE';
67
- waitMode?: 'NO_WAIT' | 'WAIT';
68
- noAutoUndo?: boolean;
69
- ignoreLimbo?: boolean;
70
- restartRequests?: boolean;
71
- autoCommit?: boolean;
72
- //// TODO: lockTimeOut?: number;
73
+ isolation?: TransactionIsolation;
74
+ readCommittedMode?: 'NO_RECORD_VERSION' | 'RECORD_VERSION';
75
+ accessMode?: 'READ_ONLY' | 'READ_WRITE';
76
+ waitMode?: 'NO_WAIT' | 'WAIT';
77
+ noAutoUndo?: boolean;
78
+ ignoreLimbo?: boolean;
79
+ restartRequests?: boolean;
80
+ autoCommit?: boolean;
81
+ //// TODO: lockTimeOut?: number;
73
82
  }
74
83
 
75
84
  /** PrepareOptions interface. */
76
- export interface PrepareOptions {
77
- }
85
+ export interface PrepareOptions {}
78
86
 
79
87
  /** ExecuteOptions interface. */
80
- export interface ExecuteOptions {
81
- }
88
+ export interface ExecuteOptions {}
82
89
 
83
90
  /** ExecuteQueryOptions interface. */
84
- export interface ExecuteQueryOptions extends ExecuteOptions {
85
- }
91
+ export interface ExecuteQueryOptions extends ExecuteOptions {}
86
92
 
87
93
  /** FetchOptions interface. */
88
94
  export interface FetchOptions {
89
- /** Number of rows to fetch. */
90
- fetchSize?: number;
95
+ /** Number of rows to fetch. */
96
+ fetchSize?: number;
91
97
  }
92
98
 
93
99
  /** CreateBlobOptions interface. */
94
100
  export interface CreateBlobOptions {
95
- type?: 'SEGMENTED' | 'STREAM';
101
+ type?: 'SEGMENTED' | 'STREAM';
96
102
  }
97
103
 
98
104
  /** Attachment interface. */
99
105
  export interface Attachment {
100
- /** Disconnects this attachment. */
101
- disconnect(): Promise<void>;
102
-
103
- /** Enable/disable cancellation of operations in this attachment. */
104
- enableCancellation(enable: boolean): Promise<void>;
105
-
106
- /** Cancel a running operation in this attachment. */
107
- cancelOperation(forcibleAbort?: boolean): Promise<void>;
108
-
109
- /** Drops the database and release this attachment. */
110
- dropDatabase(): Promise<void>;
111
-
112
- /** Creates a blob and return its stream. */
113
- createBlob(transaction: Transaction, options?: CreateBlobOptions): Promise<BlobStream>;
114
-
115
- /** Opens a blob's stream. */
116
- openBlob(transaction: Transaction, blob: Blob): Promise<BlobStream>;
117
-
118
- /** Starts a new transaction. */
119
- startTransaction(options?: TransactionOptions): Promise<Transaction>;
120
-
121
- /** Prepares a query. */
122
- prepare(transaction: Transaction, sqlStmt: string, options?: PrepareOptions): Promise<Statement>;
123
-
124
- /** Executes a statement that uses the SET TRANSACTION command. Returns the new transaction. */
125
- executeTransaction(transaction: Transaction, sqlStmt: string,
126
- options?: {
127
- prepareOptions?: PrepareOptions
128
- }): Promise<Transaction>;
129
-
130
- /** Executes a statement that has no result set. */
131
- execute(transaction: Transaction, sqlStmt: string, parameters?: any[],
132
- options?: {
133
- prepareOptions?: PrepareOptions,
134
- executeOptions?: ExecuteOptions
135
- }): Promise<void>;
136
-
137
- /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
138
- executeSingleton(transaction: Transaction, sqlStmt: string, parameters?: any[],
139
- options?: {
140
- prepareOptions?: PrepareOptions,
141
- executeOptions?: ExecuteOptions
142
- }): Promise<any[]>;
143
-
144
- /** Executes a statement that returns a single record as an object. */
145
- executeSingletonAsObject<T extends object>(transaction: Transaction, sqlStmt: string, parameters?: any[],
146
- options?: {
147
- prepareOptions?: PrepareOptions,
148
- executeOptions?: ExecuteOptions
149
- }): Promise<T>;
150
-
151
- /**
152
- * Executes a statement that returns a single record as [col1, col2, ..., colN].
153
- * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingleton.
154
- */
155
- executeReturning(transaction: Transaction, sqlStmt: string, parameters?: any[],
156
- options?: {
157
- prepareOptions?: PrepareOptions,
158
- executeOptions?: ExecuteOptions
159
- }): Promise<any[]>;
160
-
161
- /**
162
- * Executes a statement that returns a single record as an object.
163
- * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingletonAsObject.
164
- */
165
- executeReturningAsObject<T extends object>(transaction: Transaction, sqlStmt: string, parameters?: any[],
166
- options?: {
167
- prepareOptions?: PrepareOptions,
168
- executeOptions?: ExecuteOptions
169
- }): Promise<T>;
170
-
171
- /** Executes a statement that has result set. */
172
- executeQuery(transaction: Transaction, sqlStmt: string, parameters?: any[],
173
- options?: {
174
- prepareOptions?: PrepareOptions,
175
- executeOptions?: ExecuteQueryOptions
176
- }): Promise<ResultSet>;
177
-
178
- queueEvents(names: string[], callBack: (counters: [string, number][]) => Promise<void>): Promise<Events>;
179
-
180
- /** True if the attachment is connected. */
181
- readonly isValid: boolean;
182
-
183
- /** Default transaction options. */
184
- defaultTransactionOptions?: TransactionOptions;
185
-
186
- /** Default query's prepare options. */
187
- defaultPrepareOptions?: PrepareOptions;
188
-
189
- /** Default query's execute options. */
190
- defaultExecuteOptions?: ExecuteOptions;
191
-
192
- /** Default query's executeQuery options. */
193
- defaultExecuteQueryOptions?: ExecuteQueryOptions;
194
-
195
- /** Default result set's fetch options. */
196
- defaultFetchOptions?: FetchOptions;
106
+ /** Disconnects this attachment. */
107
+ disconnect(): Promise<void>;
108
+
109
+ /** Enable/disable cancellation of operations in this attachment. */
110
+ enableCancellation(enable: boolean): Promise<void>;
111
+
112
+ /** Cancel a running operation in this attachment. */
113
+ cancelOperation(forcibleAbort?: boolean): Promise<void>;
114
+
115
+ /** Drops the database and release this attachment. */
116
+ dropDatabase(): Promise<void>;
117
+
118
+ /** Creates a blob and return its stream. */
119
+ createBlob(transaction: Transaction, options?: CreateBlobOptions): Promise<BlobStream>;
120
+
121
+ /** Opens a blob's stream. */
122
+ openBlob(transaction: Transaction, blob: Blob): Promise<BlobStream>;
123
+
124
+ /** Starts a new transaction. */
125
+ startTransaction(options?: TransactionOptions): Promise<Transaction>;
126
+
127
+ /** Prepares a query. */
128
+ prepare(transaction: Transaction, sqlStmt: string, options?: PrepareOptions): Promise<Statement>;
129
+
130
+ /** Executes a statement that uses the SET TRANSACTION command. Returns the new transaction. */
131
+ executeTransaction(
132
+ transaction: Transaction,
133
+ sqlStmt: string,
134
+ options?: {
135
+ prepareOptions?: PrepareOptions;
136
+ },
137
+ ): Promise<Transaction>;
138
+
139
+ /** Executes a statement that has no result set. */
140
+ execute(
141
+ transaction: Transaction,
142
+ sqlStmt: string,
143
+ parameters?: any[],
144
+ options?: {
145
+ prepareOptions?: PrepareOptions;
146
+ executeOptions?: ExecuteOptions;
147
+ },
148
+ ): Promise<void>;
149
+
150
+ /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
151
+ executeSingleton(
152
+ transaction: Transaction,
153
+ sqlStmt: string,
154
+ parameters?: any[],
155
+ options?: {
156
+ prepareOptions?: PrepareOptions;
157
+ executeOptions?: ExecuteOptions;
158
+ },
159
+ ): Promise<any[]>;
160
+
161
+ /** Executes a statement that returns a single record as an object. */
162
+ executeSingletonAsObject<T extends object>(
163
+ transaction: Transaction,
164
+ sqlStmt: string,
165
+ parameters?: any[],
166
+ options?: {
167
+ prepareOptions?: PrepareOptions;
168
+ executeOptions?: ExecuteOptions;
169
+ },
170
+ ): Promise<T>;
171
+
172
+ /**
173
+ * Executes a statement that returns a single record as [col1, col2, ..., colN].
174
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingleton.
175
+ */
176
+ executeReturning(
177
+ transaction: Transaction,
178
+ sqlStmt: string,
179
+ parameters?: any[],
180
+ options?: {
181
+ prepareOptions?: PrepareOptions;
182
+ executeOptions?: ExecuteOptions;
183
+ },
184
+ ): Promise<any[]>;
185
+
186
+ /**
187
+ * Executes a statement that returns a single record as an object.
188
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingletonAsObject.
189
+ */
190
+ executeReturningAsObject<T extends object>(
191
+ transaction: Transaction,
192
+ sqlStmt: string,
193
+ parameters?: any[],
194
+ options?: {
195
+ prepareOptions?: PrepareOptions;
196
+ executeOptions?: ExecuteOptions;
197
+ },
198
+ ): Promise<T>;
199
+
200
+ /** Executes a statement that has result set. */
201
+ executeQuery(
202
+ transaction: Transaction,
203
+ sqlStmt: string,
204
+ parameters?: any[],
205
+ options?: {
206
+ prepareOptions?: PrepareOptions;
207
+ executeOptions?: ExecuteQueryOptions;
208
+ },
209
+ ): Promise<ResultSet>;
210
+
211
+ queueEvents(names: string[], callBack: (counters: [string, number][]) => Promise<void>): Promise<Events>;
212
+
213
+ /** True if the attachment is connected. */
214
+ readonly isValid: boolean;
215
+
216
+ /** Default transaction options. */
217
+ defaultTransactionOptions?: TransactionOptions;
218
+
219
+ /** Default query's prepare options. */
220
+ defaultPrepareOptions?: PrepareOptions;
221
+
222
+ /** Default query's execute options. */
223
+ defaultExecuteOptions?: ExecuteOptions;
224
+
225
+ /** Default query's executeQuery options. */
226
+ defaultExecuteQueryOptions?: ExecuteQueryOptions;
227
+
228
+ /** Default result set's fetch options. */
229
+ defaultFetchOptions?: FetchOptions;
197
230
  }
198
231
 
199
232
  /** Transaction interface. */
200
233
  export interface Transaction {
201
- /** Commits and release this transaction object. */
202
- commit(): Promise<void>;
234
+ /** Commits and release this transaction object. */
235
+ commit(): Promise<void>;
236
+
237
+ /** Commits and maintains this transaction object for subsequent work. */
238
+ commitRetaining(): Promise<void>;
203
239
 
204
- /** Commits and maintains this transaction object for subsequent work. */
205
- commitRetaining(): Promise<void>;
240
+ /** Rollbacks and release this transaction object. */
241
+ rollback(): Promise<void>;
206
242
 
207
- /** Rollbacks and release this transaction object. */
208
- rollback(): Promise<void>;
243
+ /** Rollbacks and maintains this transaction object for subsequent work. */
244
+ rollbackRetaining(): Promise<void>;
209
245
 
210
- /** Rollbacks and maintains this transaction object for subsequent work. */
211
- rollbackRetaining(): Promise<void>;
246
+ /** True if the transaction is active. */
247
+ readonly isValid: boolean;
248
+ }
212
249
 
213
- /** True if the transaction is active. */
214
- readonly isValid: boolean;
250
+ /** StatementType enum */
251
+ export enum StatementType {
252
+ SELECT = 1,
253
+ INSERT = 2,
254
+ UPDATE = 3,
255
+ DELETE = 4,
256
+ DDL = 5,
257
+ GET_SEGMENT = 6,
258
+ PUT_SEGMENT = 7,
259
+ EXEC_PROCEDURE = 8,
260
+ START_TRANS = 9,
261
+ COMMIT = 10,
262
+ ROLLBACK = 11,
263
+ SELECT_FOR_UPD = 12,
264
+ SET_GENERATOR = 13,
265
+ SAVEPOINT = 14,
215
266
  }
216
267
 
217
268
  /** Statement interface. */
218
269
  export interface Statement {
219
- /** Disposes this statement's resources. */
220
- dispose(): Promise<void>;
270
+ /** Disposes this statement's resources. */
271
+ dispose(): Promise<void>;
272
+
273
+ /** Executes a prepared statement that uses the SET TRANSACTION command. Returns the new transaction. */
274
+ executeTransaction(transaction: Transaction): Promise<Transaction>;
221
275
 
222
- /** Executes a prepared statement that uses the SET TRANSACTION command. Returns the new transaction. */
223
- executeTransaction(transaction: Transaction): Promise<Transaction>;
276
+ /** Executes a prepared statement that has no result set. */
277
+ execute(transaction: Transaction, parameters?: any[], options?: ExecuteOptions): Promise<void>;
224
278
 
225
- /** Executes a prepared statement that has no result set. */
226
- execute(transaction: Transaction, parameters?: any[], options?: ExecuteOptions): Promise<void>;
279
+ /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
280
+ executeSingleton(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
227
281
 
228
- /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
229
- executeSingleton(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
282
+ /** Executes a statement that returns a single record as an object. */
283
+ executeSingletonAsObject<T extends object>(
284
+ transaction: Transaction,
285
+ parameters?: any[],
286
+ executeOptions?: ExecuteOptions,
287
+ ): Promise<T>;
230
288
 
231
- /** Executes a statement that returns a single record as an object. */
232
- executeSingletonAsObject<T extends object>(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<T>;
289
+ /**
290
+ * Executes a statement that returns a single record as [col1, col2, ..., colN].
291
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingleton.
292
+ */
293
+ executeReturning(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
233
294
 
234
- /**
235
- * Executes a statement that returns a single record as [col1, col2, ..., colN].
236
- * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingleton.
237
- */
238
- executeReturning(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
295
+ /**
296
+ * Executes a statement that returns a single record as an object.
297
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingletonAsObject.
298
+ */
299
+ executeReturningAsObject<T extends object>(
300
+ transaction: Transaction,
301
+ parameters?: any[],
302
+ options?: ExecuteOptions,
303
+ ): Promise<T>;
239
304
 
240
- /**
241
- * Executes a statement that returns a single record as an object.
242
- * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingletonAsObject.
243
- */
244
- executeReturningAsObject<T extends object>(transaction: Transaction, parameters?: any[],
245
- options?: ExecuteOptions): Promise<T>;
305
+ /** Executes a prepared statement that has result set. */
306
+ executeQuery(transaction: Transaction, parameters?: any[], options?: ExecuteQueryOptions): Promise<ResultSet>;
246
307
 
247
- /** Executes a prepared statement that has result set. */
248
- executeQuery(transaction: Transaction, parameters?: any[], options?: ExecuteQueryOptions): Promise<ResultSet>;
308
+ /**
309
+ * Set cursor name of a SELECT ... FOR UPDATE statement.
310
+ *
311
+ * Use with ResultSet.fetch({ fetchSize: 1 }) and other statement with WHERE CURRENT OF <cursorName>.
312
+ */
313
+ setCursorName(cursorName: string): Promise<void>;
249
314
 
250
- /**
251
- * Set cursor name of a SELECT ... FOR UPDATE statement.
252
- *
253
- * Use with ResultSet.fetch({ fetchSize: 1 }) and other statement with WHERE CURRENT OF <cursorName>.
254
- */
255
- setCursorName(cursorName: string): Promise<void>;
315
+ getExecPathText(): Promise<string | undefined>;
256
316
 
257
- getExecPathText(): Promise<string | undefined>;
317
+ /** True if the statement has not been disposed. */
318
+ readonly isValid: boolean;
258
319
 
259
- /** True if the statement has not been disposed. */
260
- readonly isValid: boolean;
320
+ /** Gets the statement type. */
321
+ readonly type: Promise<StatementType>;
261
322
 
262
- /** Gets the query's result columns labels. Returns empty array for queries without result. */
263
- readonly columnLabels: Promise<string[]>;
323
+ /** Gets the query's result columns labels. Returns empty array for queries without result. */
324
+ readonly columnLabels: Promise<string[]>;
264
325
 
265
- /** When true, query result must be obtained with method executeQuery. */
266
- readonly hasResultSet: boolean;
326
+ /** When true, query result must be obtained with method executeQuery. */
327
+ readonly hasResultSet: boolean;
267
328
 
268
- /** Default query's execute options. */
269
- defaultExecuteOptions?: ExecuteOptions;
329
+ /** Default query's execute options. */
330
+ defaultExecuteOptions?: ExecuteOptions;
270
331
 
271
- /** Default query's executeQuery options. */
272
- defaultExecuteQueryOptions?: ExecuteQueryOptions;
332
+ /** Default query's executeQuery options. */
333
+ defaultExecuteQueryOptions?: ExecuteQueryOptions;
273
334
 
274
- /** Default result set's fetch options. */
275
- defaultFetchOptions?: FetchOptions;
335
+ /** Default result set's fetch options. */
336
+ defaultFetchOptions?: FetchOptions;
276
337
  }
277
338
 
278
339
  /** ResultSet interface. */
279
340
  export interface ResultSet {
280
- /** Closes this result set. */
281
- close(): Promise<void>;
282
-
283
- /**
284
- * Fetchs data from this result set as [col1, col2, ..., colN][].
285
- *
286
- * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
287
- *
288
- * If result set has no more rows, returns an empty array.
289
- */
290
- fetch(options?: FetchOptions): Promise<any[][]>;
291
-
292
- /**
293
- * Fetchs data from this result set as T[].
294
- * Where <T> represents your object interface.
295
- *
296
- * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
297
- *
298
- * If result set has no more rows, returns an empty array.
299
- */
300
- fetchAsObject<T extends object>(options?: FetchOptions): Promise<T[]>;
301
-
302
- /** True if the ResultSet is open. */
303
- readonly isValid: boolean;
304
-
305
- /** Default result set's fetch options. */
306
- defaultFetchOptions?: FetchOptions;
341
+ /** Closes this result set. */
342
+ close(): Promise<void>;
343
+
344
+ /**
345
+ * Fetchs data from this result set as [col1, col2, ..., colN][].
346
+ *
347
+ * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
348
+ *
349
+ * If result set has no more rows, returns an empty array.
350
+ */
351
+ fetch(options?: FetchOptions): Promise<any[][]>;
352
+
353
+ /**
354
+ * Fetchs data from this result set as T[].
355
+ * Where <T> represents your object interface.
356
+ *
357
+ * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
358
+ *
359
+ * If result set has no more rows, returns an empty array.
360
+ */
361
+ fetchAsObject<T extends object>(options?: FetchOptions): Promise<T[]>;
362
+
363
+ /** True if the ResultSet is open. */
364
+ readonly isValid: boolean;
365
+
366
+ /** Default result set's fetch options. */
367
+ defaultFetchOptions?: FetchOptions;
307
368
  }
308
369
 
309
370
  export interface Events {
310
- cancel(): Promise<void>;
371
+ cancel(): Promise<void>;
311
372
 
312
- /** True if the events' attachment is valid. */
313
- readonly isValid: boolean;
373
+ /** True if the events' attachment is valid. */
374
+ readonly isValid: boolean;
314
375
  }
315
376
 
316
377
  /** Blob class. */
317
378
  export class Blob {
318
- /** Gets the blob's attachment. */
319
- readonly attachment: Attachment;
379
+ /** Gets the blob's attachment. */
380
+ readonly attachment: Attachment;
320
381
 
321
- /** Gets the blob's id. */
322
- readonly id = new Uint8Array(8);
382
+ /** Gets the blob's id. */
383
+ readonly id = new Uint8Array(8);
323
384
 
324
- constructor(attachment: Attachment, id: Uint8Array) {
325
- this.attachment = attachment;
326
- this.id.set(id);
327
- }
385
+ constructor(attachment: Attachment, id: Uint8Array) {
386
+ this.attachment = attachment;
387
+ this.id.set(id);
388
+ }
328
389
 
329
- /** True if the blob's attachment is valid. */
330
- get isValid(): boolean {
331
- return this.attachment.isValid;
332
- }
390
+ /** True if the blob's attachment is valid. */
391
+ get isValid(): boolean {
392
+ return this.attachment.isValid;
393
+ }
333
394
  }
334
395
 
335
396
  export enum BlobSeekWhence {
336
- START = 0,
337
- CURRENT = 1,
338
- END = 2
397
+ START = 0,
398
+ CURRENT = 1,
399
+ END = 2,
339
400
  }
340
401
 
341
402
  /** BlobStream class. */
342
403
  export abstract class BlobStream {
343
- /** Gets the blob's. */
344
- readonly blob: Blob;
404
+ /** Gets the blob's. */
405
+ readonly blob: Blob;
345
406
 
346
- /** Gets the blob's stream length in bytes. */
347
- abstract get length(): Promise<number>;
407
+ /** Gets the blob's stream length in bytes. */
408
+ abstract get length(): Promise<number>;
348
409
 
349
- protected constructor(blob: Blob) {
350
- this.blob = blob;
351
- }
410
+ protected constructor(blob: Blob) {
411
+ this.blob = blob;
412
+ }
352
413
 
353
- /** Closes the blob's stream. */
354
- abstract close(): Promise<void>;
414
+ /** Closes the blob's stream. */
415
+ abstract close(): Promise<void>;
355
416
 
356
- /** Cancels the blob's creation. */
357
- abstract cancel(): Promise<void>;
417
+ /** Cancels the blob's creation. */
418
+ abstract cancel(): Promise<void>;
358
419
 
359
- /** Seeks into the blob stream and return the new position. */
360
- abstract seek(offset: number, whence?: BlobSeekWhence): Promise<number>;
420
+ /** Seeks into the blob stream and return the new position. */
421
+ abstract seek(offset: number, whence?: BlobSeekWhence): Promise<number>;
361
422
 
362
- /**
363
- * Reads data from the blob and return the number of bytes read or -1 for end-of-stream.
364
- * The number of bytes read may be less than the buffer' size while more data to be read exists.
365
- */
366
- abstract read(buffer: Buffer): Promise<number>;
423
+ /**
424
+ * Reads data from the blob and return the number of bytes read or -1 for end-of-stream.
425
+ * The number of bytes read may be less than the buffer' size while more data to be read exists.
426
+ */
427
+ abstract read(buffer: Buffer): Promise<number>;
367
428
 
368
- /** Writes data to the blob. */
369
- abstract write(buffer: Buffer): Promise<void>;
429
+ /** Writes data to the blob. */
430
+ abstract write(buffer: Buffer): Promise<void>;
370
431
 
371
- /** True if the blob stream is open. */
372
- abstract get isValid(): boolean;
432
+ /** True if the blob stream is open. */
433
+ abstract get isValid(): boolean;
373
434
  }
374
435
 
375
436
  /** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE to be sent as parameter */
376
437
  export interface ZonedDate {
377
- date: Date;
378
- timeZone: string;
438
+ date: Date;
439
+ timeZone: string;
379
440
  }
380
441
 
381
442
  /** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE returned by Firebird */
382
443
  export interface ZonedDateEx extends ZonedDate {
383
- offset: number;
444
+ offset: number;
384
445
  }