Skip to content

Commit

Permalink
fix upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
casimir committed Aug 15, 2024
1 parent 61b0b1f commit e966be3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/db/daos/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MetadataDao extends DatabaseAccessor<DB> with _$MetadataDaoMixin {
key: mkLastRefreshTS,
value: ts.toString(),
),
mode: InsertMode.replace,
mode: InsertMode.insertOrReplace,
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/services/wallabag_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ class WStorage extends _$WStorage {
.getSingleOrNull();
final writeCount = await db.transaction(() async {
var count = 0;
count += await db.articles.insertOnConflictUpdate(article);
count += await db.articles
.insertOne(article, mode: InsertMode.insertOrReplace);
if (scrollPosition?.readingTime != article.readingTime) {
count += await db.managers.articleScrollPositions
.filter((f) => f.id.equals(article.id))
Expand Down

0 comments on commit e966be3

Please sign in to comment.