mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Fetch straight from a CTE
This commit is contained in:
1 parent
2b82de42d8
commit
69c116507b
1 file changed
+11
@@ -347,6 +347,17 @@ class CommonTableExpressionTests: GRDBTestCase {
|
||||
FROM "t"
|
||||
""")
|
||||
}
|
||||
|
||||
// Select from a CTE
|
||||
do {
|
||||
enum CTE { }
|
||||
let cte = CommonTableExpression<CTE>(named: "cte", request: T.all())
|
||||
let request = cte.all().with(cte)
|
||||
try assertEqualSQL(db, request, """
|
||||
WITH "cte" AS (SELECT * FROM "t") \
|
||||
SELECT * FROM "cte"
|
||||
""")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user