node-firebird-driver 3.2.2 → 3.3.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 (41) 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.js +4 -2
  18. package/dist/lib/impl/statement.js.map +1 -1
  19. package/dist/lib/impl/time-zones.js +5 -3
  20. package/dist/lib/impl/time-zones.js.map +1 -1
  21. package/dist/lib/impl/transaction.js +2 -1
  22. package/dist/lib/impl/transaction.js.map +1 -1
  23. package/dist/lib/index.d.ts +8 -1
  24. package/dist/lib/index.js +7 -1
  25. package/dist/lib/index.js.map +1 -1
  26. package/dist/test/tests.js +176 -68
  27. package/dist/test/tests.js.map +1 -1
  28. package/package.json +6 -5
  29. package/src/lib/impl/attachment.ts +290 -253
  30. package/src/lib/impl/blob.ts +37 -35
  31. package/src/lib/impl/client.ts +60 -61
  32. package/src/lib/impl/date-time.ts +33 -33
  33. package/src/lib/impl/events.ts +17 -18
  34. package/src/lib/impl/fb-util.ts +552 -448
  35. package/src/lib/impl/resultset.ts +94 -86
  36. package/src/lib/impl/statement.ts +154 -127
  37. package/src/lib/impl/time-zones.ts +643 -641
  38. package/src/lib/impl/transaction.ts +37 -38
  39. package/src/lib/index.ts +325 -285
  40. package/src/test/tests.ts +996 -860
  41. package/tsconfig.json +7 -13
package/src/lib/index.ts CHANGED
@@ -1,384 +1,424 @@
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>;
203
236
 
204
- /** Commits and maintains this transaction object for subsequent work. */
205
- commitRetaining(): Promise<void>;
237
+ /** Commits and maintains this transaction object for subsequent work. */
238
+ commitRetaining(): Promise<void>;
206
239
 
207
- /** Rollbacks and release this transaction object. */
208
- rollback(): Promise<void>;
240
+ /** Rollbacks and release this transaction object. */
241
+ rollback(): Promise<void>;
209
242
 
210
- /** Rollbacks and maintains this transaction object for subsequent work. */
211
- rollbackRetaining(): Promise<void>;
243
+ /** Rollbacks and maintains this transaction object for subsequent work. */
244
+ rollbackRetaining(): Promise<void>;
212
245
 
213
- /** True if the transaction is active. */
214
- readonly isValid: boolean;
246
+ /** True if the transaction is active. */
247
+ readonly isValid: boolean;
215
248
  }
216
249
 
217
250
  /** Statement interface. */
218
251
  export interface Statement {
219
- /** Disposes this statement's resources. */
220
- dispose(): Promise<void>;
221
-
222
- /** Executes a prepared statement that uses the SET TRANSACTION command. Returns the new transaction. */
223
- executeTransaction(transaction: Transaction): Promise<Transaction>;
224
-
225
- /** Executes a prepared statement that has no result set. */
226
- execute(transaction: Transaction, parameters?: any[], options?: ExecuteOptions): Promise<void>;
227
-
228
- /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
229
- executeSingleton(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
230
-
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>;
233
-
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[]>;
239
-
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>;
246
-
247
- /** Executes a prepared statement that has result set. */
248
- executeQuery(transaction: Transaction, parameters?: any[], options?: ExecuteQueryOptions): Promise<ResultSet>;
249
-
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>;
256
-
257
- getExecPathText(): Promise<string | undefined>;
258
-
259
- /** True if the statement has not been disposed. */
260
- readonly isValid: boolean;
261
-
262
- /** Gets the query's result columns labels. Returns empty array for queries without result. */
263
- readonly columnLabels: Promise<string[]>;
264
-
265
- /** When true, query result must be obtained with method executeQuery. */
266
- readonly hasResultSet: boolean;
267
-
268
- /** Default query's execute options. */
269
- defaultExecuteOptions?: ExecuteOptions;
270
-
271
- /** Default query's executeQuery options. */
272
- defaultExecuteQueryOptions?: ExecuteQueryOptions;
273
-
274
- /** Default result set's fetch options. */
275
- defaultFetchOptions?: FetchOptions;
252
+ /** Disposes this statement's resources. */
253
+ dispose(): Promise<void>;
254
+
255
+ /** Executes a prepared statement that uses the SET TRANSACTION command. Returns the new transaction. */
256
+ executeTransaction(transaction: Transaction): Promise<Transaction>;
257
+
258
+ /** Executes a prepared statement that has no result set. */
259
+ execute(transaction: Transaction, parameters?: any[], options?: ExecuteOptions): Promise<void>;
260
+
261
+ /** Executes a statement that returns a single record as [col1, col2, ..., colN]. */
262
+ executeSingleton(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
263
+
264
+ /** Executes a statement that returns a single record as an object. */
265
+ executeSingletonAsObject<T extends object>(
266
+ transaction: Transaction,
267
+ parameters?: any[],
268
+ executeOptions?: ExecuteOptions,
269
+ ): Promise<T>;
270
+
271
+ /**
272
+ * Executes a statement that returns a single record as [col1, col2, ..., colN].
273
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingleton.
274
+ */
275
+ executeReturning(transaction: Transaction, parameters?: any[], executeOptions?: ExecuteOptions): Promise<any[]>;
276
+
277
+ /**
278
+ * Executes a statement that returns a single record as an object.
279
+ * @deprecated since version 2.4.0 and will be removed in next major version. Replaced by executeSingletonAsObject.
280
+ */
281
+ executeReturningAsObject<T extends object>(
282
+ transaction: Transaction,
283
+ parameters?: any[],
284
+ options?: ExecuteOptions,
285
+ ): Promise<T>;
286
+
287
+ /** Executes a prepared statement that has result set. */
288
+ executeQuery(transaction: Transaction, parameters?: any[], options?: ExecuteQueryOptions): Promise<ResultSet>;
289
+
290
+ /**
291
+ * Set cursor name of a SELECT ... FOR UPDATE statement.
292
+ *
293
+ * Use with ResultSet.fetch({ fetchSize: 1 }) and other statement with WHERE CURRENT OF <cursorName>.
294
+ */
295
+ setCursorName(cursorName: string): Promise<void>;
296
+
297
+ getExecPathText(): Promise<string | undefined>;
298
+
299
+ /** True if the statement has not been disposed. */
300
+ readonly isValid: boolean;
301
+
302
+ /** Gets the query's result columns labels. Returns empty array for queries without result. */
303
+ readonly columnLabels: Promise<string[]>;
304
+
305
+ /** When true, query result must be obtained with method executeQuery. */
306
+ readonly hasResultSet: boolean;
307
+
308
+ /** Default query's execute options. */
309
+ defaultExecuteOptions?: ExecuteOptions;
310
+
311
+ /** Default query's executeQuery options. */
312
+ defaultExecuteQueryOptions?: ExecuteQueryOptions;
313
+
314
+ /** Default result set's fetch options. */
315
+ defaultFetchOptions?: FetchOptions;
276
316
  }
277
317
 
278
318
  /** ResultSet interface. */
279
319
  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;
320
+ /** Closes this result set. */
321
+ close(): Promise<void>;
322
+
323
+ /**
324
+ * Fetchs data from this result set as [col1, col2, ..., colN][].
325
+ *
326
+ * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
327
+ *
328
+ * If result set has no more rows, returns an empty array.
329
+ */
330
+ fetch(options?: FetchOptions): Promise<any[][]>;
331
+
332
+ /**
333
+ * Fetchs data from this result set as T[].
334
+ * Where <T> represents your object interface.
335
+ *
336
+ * If an exception is found after fetching a row but before reaching options.fetchSize, its throw is delayed for the next fetch call.
337
+ *
338
+ * If result set has no more rows, returns an empty array.
339
+ */
340
+ fetchAsObject<T extends object>(options?: FetchOptions): Promise<T[]>;
341
+
342
+ /** True if the ResultSet is open. */
343
+ readonly isValid: boolean;
344
+
345
+ /** Default result set's fetch options. */
346
+ defaultFetchOptions?: FetchOptions;
307
347
  }
308
348
 
309
349
  export interface Events {
310
- cancel(): Promise<void>;
350
+ cancel(): Promise<void>;
311
351
 
312
- /** True if the events' attachment is valid. */
313
- readonly isValid: boolean;
352
+ /** True if the events' attachment is valid. */
353
+ readonly isValid: boolean;
314
354
  }
315
355
 
316
356
  /** Blob class. */
317
357
  export class Blob {
318
- /** Gets the blob's attachment. */
319
- readonly attachment: Attachment;
358
+ /** Gets the blob's attachment. */
359
+ readonly attachment: Attachment;
320
360
 
321
- /** Gets the blob's id. */
322
- readonly id = new Uint8Array(8);
361
+ /** Gets the blob's id. */
362
+ readonly id = new Uint8Array(8);
323
363
 
324
- constructor(attachment: Attachment, id: Uint8Array) {
325
- this.attachment = attachment;
326
- this.id.set(id);
327
- }
364
+ constructor(attachment: Attachment, id: Uint8Array) {
365
+ this.attachment = attachment;
366
+ this.id.set(id);
367
+ }
328
368
 
329
- /** True if the blob's attachment is valid. */
330
- get isValid(): boolean {
331
- return this.attachment.isValid;
332
- }
369
+ /** True if the blob's attachment is valid. */
370
+ get isValid(): boolean {
371
+ return this.attachment.isValid;
372
+ }
333
373
  }
334
374
 
335
375
  export enum BlobSeekWhence {
336
- START = 0,
337
- CURRENT = 1,
338
- END = 2
376
+ START = 0,
377
+ CURRENT = 1,
378
+ END = 2,
339
379
  }
340
380
 
341
381
  /** BlobStream class. */
342
382
  export abstract class BlobStream {
343
- /** Gets the blob's. */
344
- readonly blob: Blob;
383
+ /** Gets the blob's. */
384
+ readonly blob: Blob;
345
385
 
346
- /** Gets the blob's stream length in bytes. */
347
- abstract get length(): Promise<number>;
386
+ /** Gets the blob's stream length in bytes. */
387
+ abstract get length(): Promise<number>;
348
388
 
349
- protected constructor(blob: Blob) {
350
- this.blob = blob;
351
- }
389
+ protected constructor(blob: Blob) {
390
+ this.blob = blob;
391
+ }
352
392
 
353
- /** Closes the blob's stream. */
354
- abstract close(): Promise<void>;
393
+ /** Closes the blob's stream. */
394
+ abstract close(): Promise<void>;
355
395
 
356
- /** Cancels the blob's creation. */
357
- abstract cancel(): Promise<void>;
396
+ /** Cancels the blob's creation. */
397
+ abstract cancel(): Promise<void>;
358
398
 
359
- /** Seeks into the blob stream and return the new position. */
360
- abstract seek(offset: number, whence?: BlobSeekWhence): Promise<number>;
399
+ /** Seeks into the blob stream and return the new position. */
400
+ abstract seek(offset: number, whence?: BlobSeekWhence): Promise<number>;
361
401
 
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>;
402
+ /**
403
+ * Reads data from the blob and return the number of bytes read or -1 for end-of-stream.
404
+ * The number of bytes read may be less than the buffer' size while more data to be read exists.
405
+ */
406
+ abstract read(buffer: Buffer): Promise<number>;
367
407
 
368
- /** Writes data to the blob. */
369
- abstract write(buffer: Buffer): Promise<void>;
408
+ /** Writes data to the blob. */
409
+ abstract write(buffer: Buffer): Promise<void>;
370
410
 
371
- /** True if the blob stream is open. */
372
- abstract get isValid(): boolean;
411
+ /** True if the blob stream is open. */
412
+ abstract get isValid(): boolean;
373
413
  }
374
414
 
375
415
  /** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE to be sent as parameter */
376
416
  export interface ZonedDate {
377
- date: Date;
378
- timeZone: string;
417
+ date: Date;
418
+ timeZone: string;
379
419
  }
380
420
 
381
421
  /** TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE returned by Firebird */
382
422
  export interface ZonedDateEx extends ZonedDate {
383
- offset: number;
423
+ offset: number;
384
424
  }