mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Cleanup handling of subquery sources
This commit is contained in:
1 parent
420a257650
commit
da4b96c2ca
5 files changed
+78
-62
No files matched your search
@@ -78,27 +78,10 @@ extension QualifiedAllColumns: SQLSelectable {
|
||||
}
|
||||
|
||||
func countedSQL(_ context: SQLGenerationContext) -> String {
|
||||
// TODO: restore the check below.
|
||||
//
|
||||
// It is currently disabled because of AssociationAggregateTests.testHasManyIsEmpty:
|
||||
//
|
||||
// let request = Team.having(Team.players.isEmpty)
|
||||
// try XCTAssertEqual(request.fetchCount(db), 1)
|
||||
//
|
||||
// This should build the trivial count query `SELECT COUNT(*) FROM (SELECT ...)`
|
||||
//
|
||||
// Unfortunately, we don't support anonymous table aliases that would be
|
||||
// required here. Because we don't support anonymous tables aliases,
|
||||
// everything happens as if we wanted to generate
|
||||
// `SELECT COUNT(team.*) FROM (SELECT ...)`, which is invalid SQL.
|
||||
//
|
||||
// So let's always return `*`, and fix this later.
|
||||
|
||||
// if context.qualifier(for: alias) != nil {
|
||||
// // SELECT COUNT(t.*) is invalid SQL
|
||||
// fatalError("Not implemented, or invalid query")
|
||||
// }
|
||||
|
||||
if context.qualifier(for: alias) != nil {
|
||||
// SELECT COUNT(t.*) is invalid SQL
|
||||
fatalError("Not implemented, or invalid query")
|
||||
}
|
||||
return "*"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user