@qualithm/arrow-flight-sql-js 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -22
- package/dist/client.d.ts +299 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +416 -7
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +103 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +125 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/results.d.ts +11 -2
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js +18 -4
- package/dist/results.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,13 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Arrow Flight SQL JS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Arrow Flight SQL client for JavaScript and TypeScript runtimes.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
SQL-specific functionality on top of Arrow Flight for database interactions. Built on
|
|
6
|
+
[`@qualithm/arrow-flight-js`](https://github.com/qualithm/arrow-flight-js) as a peer dependency.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- Full Arrow Flight SQL protocol support
|
|
11
|
+
- Query execution with Apache Arrow result sets
|
|
12
|
+
- Prepared statements with parameter binding
|
|
13
|
+
- Transaction support (begin, commit, rollback)
|
|
14
|
+
- Database metadata queries (catalogs, schemas, tables, keys)
|
|
15
|
+
- Query cancellation
|
|
16
|
+
- TypeScript-first with comprehensive type definitions
|
|
17
|
+
- Streaming results with async iterables
|
|
18
|
+
- Comprehensive error handling with typed error codes
|
|
19
|
+
- ESM-only, tree-shakeable
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @qualithm/arrow-flight-sql-js @qualithm/arrow-flight-js apache-arrow
|
|
25
|
+
# or
|
|
26
|
+
bun add @qualithm/arrow-flight-sql-js @qualithm/arrow-flight-js apache-arrow
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> **Note:** `@qualithm/arrow-flight-js` is a peer dependency and must be installed separately.
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { createFlightSqlClient, queryToTable } from "@qualithm/arrow-flight-sql-js"
|
|
35
|
+
|
|
36
|
+
const client = await createFlightSqlClient({
|
|
37
|
+
host: "localhost",
|
|
38
|
+
port: 8815,
|
|
39
|
+
tls: false
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const table = await queryToTable(client, "SELECT * FROM users WHERE active = true")
|
|
43
|
+
console.log("Rows:", table.numRows)
|
|
44
|
+
|
|
45
|
+
for (const row of table) {
|
|
46
|
+
console.log(JSON.stringify(row))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
client.close()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
See the [examples](./examples) directory for complete, runnable demonstrations.
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
| Example | Description |
|
|
57
|
+
| ----------------------------------------------------------- | ---------------------------------------------- |
|
|
58
|
+
| [basic-query.ts](./examples/basic-query.ts) | Simple query execution with `queryToTable()` |
|
|
59
|
+
| [authentication.ts](./examples/authentication.ts) | Basic auth, bearer tokens, connection patterns |
|
|
60
|
+
| [updates.ts](./examples/updates.ts) | INSERT, UPDATE, DELETE operations |
|
|
61
|
+
| [streaming-results.ts](./examples/streaming-results.ts) | Process large datasets with `iterateResults()` |
|
|
62
|
+
| [prepared-statements.ts](./examples/prepared-statements.ts) | Parameterised queries and updates |
|
|
63
|
+
| [transactions.ts](./examples/transactions.ts) | Atomic operations with commit/rollback |
|
|
64
|
+
| [metadata-queries.ts](./examples/metadata-queries.ts) | Catalogs, schemas, tables, keys, SQL info |
|
|
65
|
+
| [cancellation.ts](./examples/cancellation.ts) | Cancel long-running queries |
|
|
66
|
+
| [error-handling.ts](./examples/error-handling.ts) | `FlightSqlError` and `FlightError` handling |
|
|
67
|
+
|
|
68
|
+
## API Reference
|
|
69
|
+
|
|
70
|
+
### Query Execution
|
|
71
|
+
|
|
72
|
+
| Method | Description |
|
|
73
|
+
| ------------------------- | ----------------------------------- |
|
|
74
|
+
| `query()` | Execute a SQL query, get FlightInfo |
|
|
75
|
+
| `executeUpdate()` | Execute INSERT/UPDATE/DELETE |
|
|
76
|
+
| `executePreparedQuery()` | Execute a prepared statement query |
|
|
77
|
+
| `executePreparedUpdate()` | Execute a prepared statement update |
|
|
78
|
+
|
|
79
|
+
### Prepared Statements
|
|
80
|
+
|
|
81
|
+
| Method | Description |
|
|
82
|
+
| --------------------------- | -------------------------------------- |
|
|
83
|
+
| `createPreparedStatement()` | Create a new prepared statement |
|
|
84
|
+
| `closePreparedStatement()` | Close and release a prepared statement |
|
|
85
|
+
| `bindParameters()` | Bind parameter values |
|
|
86
|
+
|
|
87
|
+
### Transactions
|
|
88
|
+
|
|
89
|
+
| Method | Description |
|
|
90
|
+
| -------------------- | --------------------------- |
|
|
91
|
+
| `beginTransaction()` | Start a new transaction |
|
|
92
|
+
| `commit()` | Commit a transaction |
|
|
93
|
+
| `rollback()` | Roll back a transaction |
|
|
94
|
+
| `endTransaction()` | End transaction (low-level) |
|
|
95
|
+
|
|
96
|
+
### Metadata
|
|
97
|
+
|
|
98
|
+
| Method | Description |
|
|
99
|
+
| ------------------- | ------------------------------------ |
|
|
100
|
+
| `getCatalogs()` | List available catalogs |
|
|
101
|
+
| `getDbSchemas()` | List database schemas |
|
|
102
|
+
| `getTables()` | List tables with optional filtering |
|
|
103
|
+
| `getTableTypes()` | List supported table types |
|
|
104
|
+
| `getPrimaryKeys()` | Get primary key info for a table |
|
|
105
|
+
| `getExportedKeys()` | Get foreign keys referencing a table |
|
|
106
|
+
| `getImportedKeys()` | Get foreign keys from a table |
|
|
107
|
+
| `getSqlInfo()` | Get SQL dialect/server capabilities |
|
|
108
|
+
| `getXdbcTypeInfo()` | Get supported data types |
|
|
109
|
+
|
|
110
|
+
### Result Utilities
|
|
111
|
+
|
|
112
|
+
| Function | Description |
|
|
113
|
+
| --------------------- | ------------------------------------- |
|
|
114
|
+
| `queryToTable()` | Execute query, return Arrow Table |
|
|
115
|
+
| `flightInfoToTable()` | Convert FlightInfo to Arrow Table |
|
|
116
|
+
| `ticketToTable()` | Get single ticket data as Arrow Table |
|
|
117
|
+
| `iterateResults()` | Stream results as async iterable |
|
|
118
|
+
|
|
119
|
+
### Cancellation
|
|
120
|
+
|
|
121
|
+
| Method | Description |
|
|
122
|
+
| -------------------- | ---------------------- |
|
|
123
|
+
| `cancelFlightInfo()` | Cancel a running query |
|
|
11
124
|
|
|
12
125
|
## Development
|
|
13
126
|
|
|
@@ -27,12 +140,6 @@ bun install
|
|
|
27
140
|
bun run build
|
|
28
141
|
```
|
|
29
142
|
|
|
30
|
-
### Running
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
bun run start
|
|
34
|
-
```
|
|
35
|
-
|
|
36
143
|
### Testing
|
|
37
144
|
|
|
38
145
|
```bash
|
|
@@ -47,13 +154,6 @@ bun run format
|
|
|
47
154
|
bun run typecheck
|
|
48
155
|
```
|
|
49
156
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
bun run bench
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Publishing
|
|
157
|
+
## License
|
|
57
158
|
|
|
58
|
-
|
|
59
|
-
`package.json` before merging to trigger a new release.
|
|
159
|
+
Apache-2.0
|
package/dist/client.d.ts
CHANGED
|
@@ -88,6 +88,20 @@ export type ParameterData = {
|
|
|
88
88
|
*/
|
|
89
89
|
data: Uint8Array;
|
|
90
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Result of beginning a transaction.
|
|
93
|
+
*/
|
|
94
|
+
export type TransactionResult = {
|
|
95
|
+
/**
|
|
96
|
+
* Opaque handle for the transaction on the server.
|
|
97
|
+
* Use this handle with query/update operations and commit/rollback.
|
|
98
|
+
*/
|
|
99
|
+
transactionId: Buffer;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Transaction end action.
|
|
103
|
+
*/
|
|
104
|
+
export type TransactionAction = "commit" | "rollback";
|
|
91
105
|
/**
|
|
92
106
|
* Arrow Flight SQL client for executing SQL queries and commands.
|
|
93
107
|
*
|
|
@@ -291,6 +305,291 @@ export declare class FlightSqlClient extends FlightClient {
|
|
|
291
305
|
* ```
|
|
292
306
|
*/
|
|
293
307
|
bindParameters(handle: Buffer, parameters: ParameterData, options?: CallOptions): Promise<BindParametersResult>;
|
|
308
|
+
/**
|
|
309
|
+
* Retrieves the list of catalogs (databases) available on the server.
|
|
310
|
+
*
|
|
311
|
+
* @param options - Optional call options
|
|
312
|
+
* @returns Flight information for retrieving catalog data
|
|
313
|
+
* @throws {FlightError} If the request fails
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* const info = await client.getCatalogs()
|
|
318
|
+
* const table = await flightInfoToTable(client, info)
|
|
319
|
+
* for (const row of table) {
|
|
320
|
+
* console.log("Catalog:", row.catalog_name)
|
|
321
|
+
* }
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
getCatalogs(options?: CallOptions): Promise<FlightInfo>;
|
|
325
|
+
/**
|
|
326
|
+
* Retrieves the list of database schemas.
|
|
327
|
+
*
|
|
328
|
+
* @param options - Optional filtering and call options
|
|
329
|
+
* @returns Flight information for retrieving schema data
|
|
330
|
+
* @throws {FlightError} If the request fails
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```ts
|
|
334
|
+
* // Get all schemas
|
|
335
|
+
* const info = await client.getDbSchemas()
|
|
336
|
+
*
|
|
337
|
+
* // Get schemas in a specific catalog
|
|
338
|
+
* const info = await client.getDbSchemas({ catalog: "my_database" })
|
|
339
|
+
*
|
|
340
|
+
* // Get schemas matching a pattern
|
|
341
|
+
* const info = await client.getDbSchemas({ dbSchemaFilterPattern: "public%" })
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
getDbSchemas(options?: CallOptions & {
|
|
345
|
+
catalog?: string;
|
|
346
|
+
dbSchemaFilterPattern?: string;
|
|
347
|
+
}): Promise<FlightInfo>;
|
|
348
|
+
/**
|
|
349
|
+
* Retrieves the list of tables.
|
|
350
|
+
*
|
|
351
|
+
* @param options - Optional filtering and call options
|
|
352
|
+
* @returns Flight information for retrieving table data
|
|
353
|
+
* @throws {FlightError} If the request fails
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* // Get all tables
|
|
358
|
+
* const info = await client.getTables()
|
|
359
|
+
*
|
|
360
|
+
* // Get tables with schema information
|
|
361
|
+
* const info = await client.getTables({ includeSchema: true })
|
|
362
|
+
*
|
|
363
|
+
* // Get only views
|
|
364
|
+
* const info = await client.getTables({ tableTypes: ["VIEW"] })
|
|
365
|
+
*
|
|
366
|
+
* // Get tables matching a pattern in a specific schema
|
|
367
|
+
* const info = await client.getTables({
|
|
368
|
+
* dbSchemaFilterPattern: "public",
|
|
369
|
+
* tableNameFilterPattern: "user%"
|
|
370
|
+
* })
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
getTables(options?: CallOptions & {
|
|
374
|
+
catalog?: string;
|
|
375
|
+
dbSchemaFilterPattern?: string;
|
|
376
|
+
tableNameFilterPattern?: string;
|
|
377
|
+
tableTypes?: string[];
|
|
378
|
+
includeSchema?: boolean;
|
|
379
|
+
}): Promise<FlightInfo>;
|
|
380
|
+
/**
|
|
381
|
+
* Retrieves the list of table types supported by the server.
|
|
382
|
+
*
|
|
383
|
+
* Common table types include TABLE, VIEW, and SYSTEM TABLE.
|
|
384
|
+
*
|
|
385
|
+
* @param options - Optional call options
|
|
386
|
+
* @returns Flight information for retrieving table type data
|
|
387
|
+
* @throws {FlightError} If the request fails
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```ts
|
|
391
|
+
* const info = await client.getTableTypes()
|
|
392
|
+
* const table = await flightInfoToTable(client, info)
|
|
393
|
+
* for (const row of table) {
|
|
394
|
+
* console.log("Table type:", row.table_type)
|
|
395
|
+
* }
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
398
|
+
getTableTypes(options?: CallOptions): Promise<FlightInfo>;
|
|
399
|
+
/**
|
|
400
|
+
* Retrieves the primary keys for a table.
|
|
401
|
+
*
|
|
402
|
+
* @param table - The table name to get primary keys for
|
|
403
|
+
* @param options - Optional filtering and call options
|
|
404
|
+
* @returns Flight information for retrieving primary key data
|
|
405
|
+
* @throws {FlightError} If the request fails
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* ```ts
|
|
409
|
+
* const info = await client.getPrimaryKeys("users", {
|
|
410
|
+
* catalog: "my_database",
|
|
411
|
+
* dbSchema: "public"
|
|
412
|
+
* })
|
|
413
|
+
* const table = await flightInfoToTable(client, info)
|
|
414
|
+
* for (const row of table) {
|
|
415
|
+
* console.log("Primary key column:", row.column_name)
|
|
416
|
+
* }
|
|
417
|
+
* ```
|
|
418
|
+
*/
|
|
419
|
+
getPrimaryKeys(table: string, options?: CallOptions & {
|
|
420
|
+
catalog?: string;
|
|
421
|
+
dbSchema?: string;
|
|
422
|
+
}): Promise<FlightInfo>;
|
|
423
|
+
/**
|
|
424
|
+
* Retrieves the exported keys (foreign keys that reference this table's primary key).
|
|
425
|
+
*
|
|
426
|
+
* @param table - The table name to get exported keys for
|
|
427
|
+
* @param options - Optional filtering and call options
|
|
428
|
+
* @returns Flight information for retrieving exported key data
|
|
429
|
+
* @throws {FlightError} If the request fails
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```ts
|
|
433
|
+
* const info = await client.getExportedKeys("users")
|
|
434
|
+
* const table = await flightInfoToTable(client, info)
|
|
435
|
+
* for (const row of table) {
|
|
436
|
+
* console.log(`${row.fk_table_name}.${row.fk_column_name} -> ${row.pk_column_name}`)
|
|
437
|
+
* }
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
getExportedKeys(table: string, options?: CallOptions & {
|
|
441
|
+
catalog?: string;
|
|
442
|
+
dbSchema?: string;
|
|
443
|
+
}): Promise<FlightInfo>;
|
|
444
|
+
/**
|
|
445
|
+
* Retrieves the imported keys (foreign keys in this table that reference other tables).
|
|
446
|
+
*
|
|
447
|
+
* @param table - The table name to get imported keys for
|
|
448
|
+
* @param options - Optional filtering and call options
|
|
449
|
+
* @returns Flight information for retrieving imported key data
|
|
450
|
+
* @throws {FlightError} If the request fails
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* ```ts
|
|
454
|
+
* const info = await client.getImportedKeys("orders")
|
|
455
|
+
* const table = await flightInfoToTable(client, info)
|
|
456
|
+
* for (const row of table) {
|
|
457
|
+
* console.log(`${row.fk_column_name} -> ${row.pk_table_name}.${row.pk_column_name}`)
|
|
458
|
+
* }
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
461
|
+
getImportedKeys(table: string, options?: CallOptions & {
|
|
462
|
+
catalog?: string;
|
|
463
|
+
dbSchema?: string;
|
|
464
|
+
}): Promise<FlightInfo>;
|
|
465
|
+
/**
|
|
466
|
+
* Retrieves SQL information about the server's capabilities.
|
|
467
|
+
*
|
|
468
|
+
* @param info - Array of SqlInfo codes to retrieve; if empty, returns all
|
|
469
|
+
* @param options - Optional call options
|
|
470
|
+
* @returns Flight information for retrieving SQL info data
|
|
471
|
+
* @throws {FlightError} If the request fails
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* ```ts
|
|
475
|
+
* // Get all SQL info
|
|
476
|
+
* const info = await client.getSqlInfo()
|
|
477
|
+
*
|
|
478
|
+
* // Get specific info (use SqlInfo enum values)
|
|
479
|
+
* const info = await client.getSqlInfo([0, 1, 2]) // server name, version, arrow version
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
482
|
+
getSqlInfo(info?: number[], options?: CallOptions): Promise<FlightInfo>;
|
|
483
|
+
/**
|
|
484
|
+
* Retrieves information about data types supported by the server.
|
|
485
|
+
*
|
|
486
|
+
* @param options - Optional data type filter and call options
|
|
487
|
+
* @returns Flight information for retrieving type info data
|
|
488
|
+
* @throws {FlightError} If the request fails
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```ts
|
|
492
|
+
* // Get all type info
|
|
493
|
+
* const info = await client.getXdbcTypeInfo()
|
|
494
|
+
*
|
|
495
|
+
* // Get info for a specific data type
|
|
496
|
+
* const info = await client.getXdbcTypeInfo({ dataType: 12 }) // VARCHAR
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
getXdbcTypeInfo(options?: CallOptions & {
|
|
500
|
+
dataType?: number;
|
|
501
|
+
}): Promise<FlightInfo>;
|
|
502
|
+
/**
|
|
503
|
+
* Begins a new transaction.
|
|
504
|
+
*
|
|
505
|
+
* Returns a transaction ID that can be passed to query, update, and
|
|
506
|
+
* prepared statement operations to execute them within the transaction.
|
|
507
|
+
* Call `commit()` or `rollback()` to end the transaction.
|
|
508
|
+
*
|
|
509
|
+
* @param options - Optional call options
|
|
510
|
+
* @returns The transaction result containing the transaction ID
|
|
511
|
+
* @throws {FlightError} If the server does not support transactions or the request fails
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```ts
|
|
515
|
+
* const txn = await client.beginTransaction()
|
|
516
|
+
*
|
|
517
|
+
* try {
|
|
518
|
+
* await client.executeUpdate(
|
|
519
|
+
* "INSERT INTO users (name) VALUES ('Alice')",
|
|
520
|
+
* { transactionId: txn.transactionId }
|
|
521
|
+
* )
|
|
522
|
+
* await client.executeUpdate(
|
|
523
|
+
* "UPDATE accounts SET balance = balance - 100 WHERE user = 'Alice'",
|
|
524
|
+
* { transactionId: txn.transactionId }
|
|
525
|
+
* )
|
|
526
|
+
* await client.commit(txn.transactionId)
|
|
527
|
+
* } catch (error) {
|
|
528
|
+
* await client.rollback(txn.transactionId)
|
|
529
|
+
* throw error
|
|
530
|
+
* }
|
|
531
|
+
* ```
|
|
532
|
+
*/
|
|
533
|
+
beginTransaction(options?: CallOptions): Promise<TransactionResult>;
|
|
534
|
+
/**
|
|
535
|
+
* Ends a transaction with the specified action.
|
|
536
|
+
*
|
|
537
|
+
* This is a lower-level method. Consider using `commit()` or `rollback()`
|
|
538
|
+
* for more readable code.
|
|
539
|
+
*
|
|
540
|
+
* @param transactionId - The transaction ID from beginTransaction
|
|
541
|
+
* @param action - Whether to commit or rollback the transaction
|
|
542
|
+
* @param options - Optional call options
|
|
543
|
+
* @throws {FlightError} If the request fails
|
|
544
|
+
*/
|
|
545
|
+
endTransaction(transactionId: Buffer, action: TransactionAction, options?: CallOptions): Promise<void>;
|
|
546
|
+
/**
|
|
547
|
+
* Commits a transaction.
|
|
548
|
+
*
|
|
549
|
+
* All operations executed within the transaction are made permanent.
|
|
550
|
+
* The transaction ID becomes invalid after this call.
|
|
551
|
+
*
|
|
552
|
+
* @param transactionId - The transaction ID from beginTransaction
|
|
553
|
+
* @param options - Optional call options
|
|
554
|
+
* @throws {FlightError} If the commit fails
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```ts
|
|
558
|
+
* const txn = await client.beginTransaction()
|
|
559
|
+
* await client.executeUpdate(
|
|
560
|
+
* "INSERT INTO users (name) VALUES ('Alice')",
|
|
561
|
+
* { transactionId: txn.transactionId }
|
|
562
|
+
* )
|
|
563
|
+
* await client.commit(txn.transactionId)
|
|
564
|
+
* ```
|
|
565
|
+
*/
|
|
566
|
+
commit(transactionId: Buffer, options?: CallOptions): Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Rolls back a transaction.
|
|
569
|
+
*
|
|
570
|
+
* All operations executed within the transaction are undone.
|
|
571
|
+
* The transaction ID becomes invalid after this call.
|
|
572
|
+
*
|
|
573
|
+
* @param transactionId - The transaction ID from beginTransaction
|
|
574
|
+
* @param options - Optional call options
|
|
575
|
+
* @throws {FlightError} If the rollback fails
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```ts
|
|
579
|
+
* const txn = await client.beginTransaction()
|
|
580
|
+
* try {
|
|
581
|
+
* await client.executeUpdate(
|
|
582
|
+
* "INSERT INTO users (name) VALUES ('Alice')",
|
|
583
|
+
* { transactionId: txn.transactionId }
|
|
584
|
+
* )
|
|
585
|
+
* await client.commit(txn.transactionId)
|
|
586
|
+
* } catch (error) {
|
|
587
|
+
* await client.rollback(txn.transactionId)
|
|
588
|
+
* throw error
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
rollback(transactionId: Buffer, options?: CallOptions): Promise<void>;
|
|
294
593
|
}
|
|
295
594
|
/**
|
|
296
595
|
* Creates a new FlightSqlClient and connects to the server.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,WAAW,EAGhB,YAAY,EACZ,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,WAAW,EAGhB,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAA;AA+ClC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;I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