Fetch straight from a CTE

This commit is contained in:
Gwendal Roué committed 2020-12-02 18:40:58 +01:00
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"
""")
}
}
}
}