mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
So long, visitor pattern!
This commit is contained in:
1 parent
cc0611847d
commit
6abbf82a89
49 files changed
+2242
-2921
No files matched your search
@@ -119,9 +119,9 @@ extension SQLQuery {
|
||||
countQuery.isDistinct = false
|
||||
switch count {
|
||||
case .all:
|
||||
countQuery = countQuery.select(_SQLExpressionCount(AllColumns()))
|
||||
countQuery = countQuery.select(SQLExpressionCount(AllColumns()))
|
||||
case .distinct(let expression):
|
||||
countQuery = countQuery.select(_SQLExpressionCountDistinct(expression))
|
||||
countQuery = countQuery.select(SQLExpressionCountDistinct(expression))
|
||||
}
|
||||
return try QueryInterfaceRequest(query: countQuery).fetchOne(db)!
|
||||
} else {
|
||||
@@ -134,7 +134,7 @@ extension SQLQuery {
|
||||
// SELECT expr1, expr2, ... FROM tableName ...
|
||||
// ->
|
||||
// SELECT COUNT(*) FROM tableName ...
|
||||
let countQuery = unordered().select(_SQLExpressionCount(AllColumns()))
|
||||
let countQuery = unordered().select(SQLExpressionCount(AllColumns()))
|
||||
return try QueryInterfaceRequest(query: countQuery).fetchOne(db)!
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user