Skip to content

Commit fb38d0b

Browse files
committed
refactor: add createTxWriter method to TopicClient for transaction support
Signed-off-by: Vladislav Polyakov <[email protected]>
1 parent c88ce2b commit fb38d0b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/topic/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Driver } from "@ydbjs/core";
22

33
import { TopicReader, type TopicReaderOptions } from "./reader.js";
4-
import { type TopicWriter, type TopicWriterOptions, createTopicWriter } from "./writer/index.ts";
4+
import { type TopicWriter, type TopicWriterOptions, createTopicTxWriter, createTopicWriter } from "./writer/index.js";
5+
import type { TX } from "./writer/tx.js";
56

67
export interface TopicClient {
78
createReader(options: TopicReaderOptions): TopicReader;
89
createWriter(options: TopicWriterOptions): TopicWriter;
10+
createTxWriter(tx: TX, options: TopicWriterOptions): TopicWriter;
911
}
1012

1113
export function topic(driver: Driver): TopicClient {
@@ -16,5 +18,8 @@ export function topic(driver: Driver): TopicClient {
1618
createWriter(options: TopicWriterOptions) {
1719
return createTopicWriter(driver, options);
1820
},
21+
createTxWriter(tx: TX, options: TopicWriterOptions) {
22+
return createTopicTxWriter(driver, tx, options);
23+
},
1924
} as TopicClient
2025
}

0 commit comments

Comments
 (0)