mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Internal API experiment: KeyPathRefining
This commit is contained in:
1 parent
66bce33a36
commit
349e34b1c1
12 files changed
+162
-171
No files matched your search
@@ -574,13 +574,14 @@ private struct SQLQualifiedRelation {
|
||||
|
||||
/// Removes all selections from joins
|
||||
func selectOnly(_ selection: [SQLSelectable]) -> SQLQualifiedRelation {
|
||||
var relation = self
|
||||
relation.sourceSelection = selection.map { $0.qualifiedSelectable(with: sourceAlias) }
|
||||
relation.joins = relation.joins.mapValues { $0.selectOnly([]) }
|
||||
return relation
|
||||
return self
|
||||
.with(\.sourceSelection, selection.map { $0.qualifiedSelectable(with: sourceAlias) })
|
||||
.map(\.joins, { $0.mapValues { $0.selectOnly([]) } })
|
||||
}
|
||||
}
|
||||
|
||||
extension SQLQualifiedRelation: KeyPathRefining { }
|
||||
|
||||
/// A "qualified" source, where all tables are identified with a table alias.
|
||||
private enum SQLQualifiedSource {
|
||||
case table(tableName: String, alias: TableAlias)
|
||||
|
||||
Reference in new issue
Block a user