Skip to content

Commit

Permalink
expose transaction behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
dikatok committed Aug 23, 2024
1 parent bf90562 commit 21cc466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/libsql_dart.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
library libsql_dart;

export 'src/libsql_client.dart';
export 'src/rust/api/transaction.dart' show LibsqlTransactionBehavior;
5 changes: 3 additions & 2 deletions lib/src/libsql_client.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:libsql_dart/src/helpers.dart';
import 'package:libsql_dart/src/rust/api/api.dart' as libsql;
import 'package:libsql_dart/src/rust/api/api.dart';
import 'package:libsql_dart/src/rust/api/transaction.dart';
import 'package:libsql_dart/src/rust/frb_generated.dart';
import 'package:libsql_dart/src/rust/utils/params.dart';
import 'package:libsql_dart/src/statement.dart';
Expand Down Expand Up @@ -200,9 +201,9 @@ class LibsqlClient {
}
}

Future<Transaction> transaction() async {
Future<Transaction> transaction({LibsqlTransactionBehavior? behavior}) async {
if (_connection == null) throw Exception('Database is not connected');
final res = await _connection!.transaction();
final res = await _connection!.transaction(behavior: behavior);
if (res.errorMessage?.isNotEmpty ?? false) {
throw Exception(res.errorMessage);
}
Expand Down

0 comments on commit 21cc466

Please sign in to comment.