mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
CommonTableExpression is a table, after all
This commit is contained in:
1 parent
755782759a
commit
ec2640a459
7 files changed
+154
-184
No files matched your search
@@ -273,9 +273,6 @@ extension QueryInterfaceRequest: TableRequest {
|
||||
// request.filter(keys: ...)
|
||||
// request.orderByPrimaryKey()
|
||||
return tableName
|
||||
case .commonTableExpression:
|
||||
#warning("TODO: is this ok?")
|
||||
fatalError("Request is not based on a database table")
|
||||
case .subquery:
|
||||
// The only current use case for SQLSource.query is the
|
||||
// "trivial count query" (see SQLQuery.countQuery):
|
||||
@@ -341,7 +338,7 @@ extension QueryInterfaceRequest {
|
||||
|
||||
#warning("TODO: doc")
|
||||
public func with(_ cte: CommonTableExpression) -> Self {
|
||||
map(\.query) { $0.with(\.ctes[cte.key], cte) }
|
||||
map(\.query) { $0.with(\.ctes[cte.tableName], cte.request) }
|
||||
}
|
||||
|
||||
/// Creates a request bound to type RowDecoder.
|
||||
|
||||
Reference in new issue
Block a user