node-firebird-driver-native 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.
- package/README.md +18 -20
- package/dist/lib/attachment.js +4 -4
- package/dist/lib/attachment.js.map +1 -1
- package/dist/lib/blob.js +6 -4
- package/dist/lib/blob.js.map +1 -1
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/events.js.map +1 -1
- package/dist/lib/fb-util.js +5 -3
- package/dist/lib/fb-util.js.map +1 -1
- package/dist/lib/resultset.d.ts +1 -1
- package/dist/lib/resultset.js +11 -5
- package/dist/lib/resultset.js.map +1 -1
- package/dist/lib/statement.d.ts +4 -4
- package/dist/lib/statement.js +12 -8
- package/dist/lib/statement.js.map +1 -1
- package/dist/lib/transaction.js +4 -4
- package/dist/lib/transaction.js.map +1 -1
- package/package.json +8 -7
- package/src/lib/attachment.ts +92 -79
- package/src/lib/blob.ts +103 -89
- package/src/lib/client.ts +41 -48
- package/src/lib/events.ts +26 -24
- package/src/lib/fb-util.ts +73 -73
- package/src/lib/resultset.ts +94 -82
- package/src/lib/statement.ts +155 -141
- package/src/lib/transaction.ts +42 -37
- package/tsconfig.json +8 -17
package/src/lib/transaction.ts
CHANGED
|
@@ -6,43 +6,48 @@ import { AbstractTransaction } from 'node-firebird-driver/dist/lib/impl';
|
|
|
6
6
|
|
|
7
7
|
import * as fb from 'node-firebird-native-api';
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
/** Transaction implementation. */
|
|
11
10
|
export class TransactionImpl extends AbstractTransaction {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
11
|
+
// Override declarations.
|
|
12
|
+
override attachment: AttachmentImpl;
|
|
13
|
+
|
|
14
|
+
transactionHandle?: fb.Transaction;
|
|
15
|
+
|
|
16
|
+
static async start(attachment: AttachmentImpl, options?: TransactionOptions): Promise<TransactionImpl> {
|
|
17
|
+
const transaction = new TransactionImpl(attachment);
|
|
18
|
+
|
|
19
|
+
return await attachment.client.statusAction(async (status) => {
|
|
20
|
+
const tpb = createTpb(options);
|
|
21
|
+
transaction.transactionHandle = await attachment!.attachmentHandle!.startTransactionAsync(
|
|
22
|
+
status,
|
|
23
|
+
tpb.length,
|
|
24
|
+
tpb,
|
|
25
|
+
);
|
|
26
|
+
return transaction;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Commits and release this transaction object. */
|
|
31
|
+
protected async internalCommit(): Promise<void> {
|
|
32
|
+
await this.attachment.client.statusAction((status) => this.transactionHandle!.commitAsync(status));
|
|
33
|
+
this.transactionHandle = undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Commits and maintains this transaction object for subsequent work. */
|
|
37
|
+
protected async internalCommitRetaining(): Promise<void> {
|
|
38
|
+
return await this.attachment.client.statusAction((status) => this.transactionHandle!.commitRetainingAsync(status));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Rollbacks and release this transaction object. */
|
|
42
|
+
protected async internalRollback(): Promise<void> {
|
|
43
|
+
await this.attachment.client.statusAction((status) => this.transactionHandle!.rollbackAsync(status));
|
|
44
|
+
this.transactionHandle = undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Rollbacks and maintains this transaction object for subsequent work. */
|
|
48
|
+
protected async internalRollbackRetaining(): Promise<void> {
|
|
49
|
+
return await this.attachment.client.statusAction((status) =>
|
|
50
|
+
this.transactionHandle!.rollbackRetainingAsync(status),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
48
53
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"references": [
|
|
11
|
-
{ "path": "../node-firebird-driver" },
|
|
12
|
-
{ "path": "../node-firebird-native-api" }
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"dist",
|
|
17
|
-
"build"
|
|
18
|
-
]
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "./src",
|
|
5
|
+
"outDir": "./dist"
|
|
6
|
+
},
|
|
7
|
+
"include": ["./src/**/*"],
|
|
8
|
+
"references": [{ "path": "../node-firebird-driver" }, { "path": "../node-firebird-native-api" }],
|
|
9
|
+
"exclude": ["node_modules", "dist", "build"]
|
|
19
10
|
}
|