You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -90,6 +92,22 @@ final deleted = await db.delete(created['id']);
90
92
91
93
For more code examples, kindly refer to the [integration test](https://github.com/limcheekin/surrealdb_wasm/blob/main/integration_test/surrealdb_wasm_test.dart) and the [example project](https://github.com/limcheekin/surrealdb_wasm/blob/main/example/lib/main.dart).
92
94
95
+
### Transaction Support
96
+
97
+
```dart
98
+
final result = await db.transaction((txn) async {
99
+
txn.query('DEFINE TABLE test SCHEMAFULL;');
100
+
txn.query('DEFINE FIELD id ON test TYPE record;');
101
+
txn.query('DEFINE FIELD name ON test TYPE string;');
102
+
txn.query(
103
+
r'CREATE test SET name = $name;',
104
+
bindings: {'name': 'John'},
105
+
);
106
+
});
107
+
```
108
+
109
+
For more code examples, kindly refer to the [integration test of transaction](https://github.com/limcheekin/surrealdb_wasm/blob/main/integration_test/transaction_test.dart).
110
+
93
111
## 🧑💼 Contributing
94
112
95
113
Contributions are welcome! Please check out the unimplemented features above, issues on the repository, and feel free to open a pull request.
0 commit comments