Incorporate doc lib v4 ordering

This commit is contained in:
2024-08-22 23:00:25 -04:00
parent d4c0e4e26c
commit cc3e41ddc5
15 changed files with 184 additions and 181 deletions
@@ -16,16 +16,18 @@ type SQLiteCategoryData(conn: SqliteConnection, ser: JsonSerializer, log: ILogge
let parentIdField = nameof Category.Empty.ParentId
/// Count all categories for the given web log
let countAll webLogId =
let countAll webLogId = backgroundTask {
log.LogTrace "Category.countAll"
Document.countByWebLog Table.Category webLogId conn
let! count = conn.countByFields Table.Category Any [ webLogField webLogId ]
return int count
}
/// Count all top-level categories for the given web log
let countTopLevel webLogId =
let countTopLevel webLogId = backgroundTask {
log.LogTrace "Category.countTopLevel"
let fields = [ webLogField webLogId; Field.NEX parentIdField ]
conn.customScalar
(Query.byFields (Query.count Table.Category) All fields) (addFieldParams fields []) (toCount >> int)
let! count = conn.countByFields Table.Category All [ webLogField webLogId; Field.NEX parentIdField ]
return int count
}
/// Find all categories for the given web log
let findByWebLog webLogId =