close tabs by host

This commit is contained in:
Fabian Freund
2025-06-02 22:22:07 +02:00
parent f6e0f665ce
commit 8fccd767af
9 changed files with 91 additions and 16 deletions
@@ -66,6 +66,20 @@ class ContainerDao extends DatabaseAccessor<TabDatabase>
return query.map((row) => row.read(db.tab.id)!);
}
Selectable<TabData> getContainerTabsData(String? containerId) {
final query =
db.tab.select()
..where(
(t) =>
(containerId != null)
? t.containerId.equals(containerId)
: t.containerId.isNull(),
)
..orderBy([(t) => OrderingTerm.asc(t.orderKey)]);
return query;
}
SingleSelectable<String> generateLeadingOrderKey(
String? containerId, {
int bucket = 0,