Skip to content

Commit 87c0d1d

Browse files
committed
feat: add description of db.transaction()
1 parent 19d0dfb commit 87c0d1d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

example/lib/main.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,18 @@ class _HomePageState extends State<HomePage> {
221221
'db.delete()',
222222
);
223223

224-
await execute(() => db.transaction((txn) async {
225-
txn.query('DEFINE TABLE test SCHEMAFULL;');
226-
txn.query('DEFINE FIELD name ON test TYPE string;');
227-
txn.query(
228-
r'CREATE test SET name = $name;',
229-
bindings: {'name': 'John'},
230-
);
231-
}));
224+
await execute(
225+
() => db.transaction(
226+
(txn) async {
227+
txn.query('DEFINE TABLE test SCHEMAFULL;');
228+
txn.query('DEFINE FIELD name ON test TYPE string;');
229+
txn.query(
230+
r'CREATE test SET name = $name;',
231+
bindings: {'name': 'John'},
232+
);
233+
},
234+
),
235+
'db.transaction()');
232236
}
233237

234238
@override

0 commit comments

Comments
 (0)