major update
This commit is contained in:
@@ -10,7 +10,7 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
|
||||
ArticleDao(super.attachedDatabase);
|
||||
|
||||
Selectable<FeedArticle> getFeedArticles(Uri? url) {
|
||||
final select = db.article.select();
|
||||
final select = db.articleView.select();
|
||||
|
||||
if (url != null) {
|
||||
select.where((article) => article.feedId.equalsValue(url));
|
||||
@@ -25,7 +25,7 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
|
||||
}
|
||||
|
||||
SingleOrNullSelectable<FeedArticle> getArticleById(String articleId) {
|
||||
return db.article.select()..where((row) => row.id.equals(articleId));
|
||||
return db.articleView.select()..where((row) => row.id.equals(articleId));
|
||||
}
|
||||
|
||||
Future<void> upsertArticles(List<FeedArticle> articles) {
|
||||
@@ -111,8 +111,6 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
|
||||
return db.queryArticlesBasic(
|
||||
feedId: feedId?.toString(),
|
||||
query: db.buildLikeQuery(searchString),
|
||||
beforeMatch: matchPrefix,
|
||||
afterMatch: matchSuffix,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,15 +11,19 @@ class FeedDao extends DatabaseAccessor<FeedDatabase> with _$FeedDaoMixin {
|
||||
return db.feed.select();
|
||||
}
|
||||
|
||||
Future<int> updateFeedFetched(Uri url, DateTime fetched) {
|
||||
SingleOrNullSelectable<FeedData> getFeed(Uri feedId) {
|
||||
return db.feed.select()..where((feed) => feed.url.equalsValue(feedId));
|
||||
}
|
||||
|
||||
Future<int> updateFeedFetched(Uri feedId, DateTime fetched) {
|
||||
final statement =
|
||||
db.feed.update()..where((feed) => feed.url.equalsValue(url));
|
||||
db.feed.update()..where((feed) => feed.url.equalsValue(feedId));
|
||||
|
||||
return statement.write(FeedCompanion(lastFetched: Value(fetched)));
|
||||
}
|
||||
|
||||
Future<int> deleteFeed(Uri url) {
|
||||
return db.feed.deleteWhere((feed) => feed.url.equals(url.toString()));
|
||||
Future<int> deleteFeed(Uri feedId) {
|
||||
return db.feed.deleteWhere((feed) => feed.url.equals(feedId.toString()));
|
||||
}
|
||||
|
||||
Future<int> upsertFeed(FeedData feedData) {
|
||||
|
||||
Reference in New Issue
Block a user