mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Refactor column counting for improved testability
This commit is contained in:
1 parent
ac436a2770
commit
8ad096ae35
3 files changed
+38
-17
No files matched your search
@@ -102,9 +102,7 @@ struct SQLQueryGenerator: Refinable {
|
||||
try relation
|
||||
.selectionPromise
|
||||
.resolve(db)
|
||||
.reduce(0) {
|
||||
try $0 + $1.columnCount(db)
|
||||
}
|
||||
.columnCount(db)
|
||||
}
|
||||
|
||||
/// Returns a select statement
|
||||
@@ -608,9 +606,7 @@ private struct SQLQualifiedRelation {
|
||||
|
||||
// The number of columns in source selection. Columns selected by joined
|
||||
// relations are appended after.
|
||||
let sourceSelectionWidth = try sourceSelectionPromise.resolve(db).reduce(0) {
|
||||
try $0 + $1.columnCount(db)
|
||||
}
|
||||
let sourceSelectionWidth = try sourceSelectionPromise.resolve(db).columnCount(db)
|
||||
|
||||
// Recursively build adapters for each joined relation with a selection.
|
||||
// Name them according to the join keys.
|
||||
|
||||
Reference in new issue
Block a user