Documentation

This commit is contained in:
Gwendal Roué committed 2020-04-30 15:21:41 +02:00
1 parent 72e4fc620b
commit d67f4802d3
1 file changed
+2
+2
View File
@@ -96,6 +96,8 @@ extension SQLQuery: _JoinableRequest {
extension SQLQuery {
func fetchCount(_ db: Database) throws -> Int {
// FIXME: eventually have the line below generate SQL without trailing "LIMIT 1"
// return try QueryInterfaceRequest<Int>(query: countQuery(db)).fetchOne(db)!
let (statement, adapter) = try SQLQueryGenerator(query: countQuery(db)).prepare(db)
return try Int.fetchOne(statement, adapter: adapter)!
}