CTE associations

This commit is contained in:
Gwendal Roué committed 2020-11-30 21:51:17 +01:00
1 parent c776ee8d47
commit b7b89c5fa9
7 files changed
+193 -16

No files matched your search

@@ -337,8 +337,17 @@ extension QueryInterfaceRequest {
}
#warning("TODO: doc")
public func with(_ cte: CommonTableExpression) -> Self {
map(\.query) { $0.with(\.ctes[cte.tableName], cte.request) }
public func with(_ ctes: CommonTableExpression...) -> Self {
with(ctes)
}
#warning("TODO: doc")
public func with(_ ctes: [CommonTableExpression]) -> Self {
mapInto(\.query.ctes) {
for cte in ctes {
$0[cte.tableName] = cte.request
}
}
}
/// Creates a request bound to type RowDecoder.