reverse search bangs

This commit is contained in:
Fabian Freund
2026-05-27 10:06:24 +02:00
parent 7275ac9400
commit 5a7b0aa6cb
6 changed files with 800 additions and 1 deletions
@@ -128,6 +128,17 @@ class BangDao extends DatabaseAccessor<BangDatabase> with $BangDaoMixin {
);
}
Selectable<BangData> getBangDataByTemplateHost(String host) {
final httpsPrefix = 'https://$host/%';
final httpPrefix = 'http://$host/%';
return select(db.bangDataView)
..where(
(t) =>
t.urlTemplate.like(httpsPrefix) | t.urlTemplate.like(httpPrefix),
);
}
Selectable<BangData> queryBangs(String searchString) {
final ftsQuery = db.buildFtsQuery(searchString);