@@ -30,28 +30,28 @@ void main() async {
3030
3131 final database = AppDatabase ();
3232
33- await database.transaction (() async {
34- // Create the table if it doesn't exist
35- final result = await database.into (database.todoItems).insert (
36- TodoItemsCompanion .insert (
37- title: 'todo: setup drift' ,
38- content: 'We need to set up drift for our SQLite database.' ,
39- ),
40- );
41-
42- await (database
43- .update (database.todoItems)
44- ..where ((tbl) => tbl.id.equals (result)))
45- .write (TodoItemsCompanion (content: const Value ('Updated content' )));
46-
47-
48- print ('Inserted item with ID: $result ' );
49- });
50-
51- // final allItems = await database.select(database.todoItems).get();
52- // for (final item in allItems) {
53- // print('Item: ${item.title}, Content: ${item.content}');
54- // }
33+ // await database.transaction(() async {
34+ // // Create the table if it doesn't exist
35+ // final result = await database.into(database.todoItems).insert(
36+ // TodoItemsCompanion.insert(
37+ // title: 'todo: setup drift',
38+ // content: 'We need to set up drift for our SQLite database.',
39+ // ),
40+ // );
41+
42+ // await (database
43+ // .update(database.todoItems)
44+ // ..where((tbl) => tbl.id.equals(result)))
45+ // .write(TodoItemsCompanion(content: const Value('Updated content')));
46+
47+
48+ // print('Inserted item with ID: $result');
49+ // });
50+
51+ final allItems = await database.select (database.todoItems).get ();
52+ for (final item in allItems) {
53+ print ('Item: ${item .title }, Content: ${item .content }' );
54+ }
5555
5656 // final server = await HttpServer.bind(InternetAddress.anyIPv4, 8081);
5757
0 commit comments