Skip to content

Commit d727823

Browse files
committed
A few bug fixes when writing to the database.
1 parent cfa8060 commit d727823

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

demos/MAUITodo/Data/PowerSyncData.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public PowerSyncData()
2121
});
2222
var logger = loggerFactory.CreateLogger("PowerSyncLogger");
2323

24-
var dbPath = Path.Combine(FileSystem.AppDataDirectory, "examplsee.db");
24+
var dbPath = Path.Combine(FileSystem.AppDataDirectory, "example.db");
2525
var factory = new MAUISQLiteDBOpenFactory(new MDSQLiteOpenFactoryOptions()
2626
{
2727
DbFilename = dbPath
@@ -50,8 +50,8 @@ await Db.Execute(
5050
else
5151
{
5252
await Db.Execute(
53-
"INSERT INTO lists (id, created_at, name, owner_id, created_at) VALUES (uuid(), datetime(), ?, ?, ?)",
54-
[list.Name, UserId, DateTime.UtcNow.ToString("o")]);
53+
"INSERT INTO lists (id, created_at, name, owner_id) VALUES (uuid(), datetime(), ?, ?)",
54+
[list.Name, UserId]);
5555
}
5656
}
5757

@@ -82,14 +82,14 @@ await Db.Execute(
8282
{
8383
await Db.Execute(
8484
@"INSERT INTO todos
85-
(id, list_id, description, created_at, completed, created_by, created_at)
86-
VALUES (uuid(), ?, ?, ?, ?, ?, datetime())",
85+
(id, list_id, description, created_at, completed, created_by, completed_at)
86+
VALUES (uuid(), ?, ?, datetime(), ?, ?, ?)",
8787
[
8888
item.ListId,
8989
item.Description,
90-
item.CreatedAt,
9190
item.Completed ? 1 : 0,
92-
UserId
91+
UserId,
92+
item.CompletedAt!,
9393
]);
9494
}
9595
}

0 commit comments

Comments
 (0)