Create CTE without request

This commit is contained in:
Gwendal Roué committed 2020-12-02 06:00:04 +01:00
1 parent 2c42d0129c
commit 3a38cbe87f
2 files changed
+64 -4

No files matched your search

@@ -5,6 +5,35 @@ public struct CommonTableExpression<RowDecoder> {
var request: _FetchRequest
}
extension CommonTableExpression {
#warning("TODO: doc")
public init(
tableName: String,
columns: [Column]? = nil,
sql: String,
arguments: StatementArguments = StatementArguments(),
type: RowDecoder.Type = RowDecoder.self)
{
self.init(
tableName: tableName,
columns: columns,
request: SQLRequest<Void>(sql: sql, arguments: arguments))
}
#warning("TODO: doc")
public init(
tableName: String,
columns: [Column]? = nil,
literal: SQLLiteral,
type: RowDecoder.Type = RowDecoder.self)
{
self.init(
tableName: tableName,
columns: columns,
request: SQLRequest<Void>(literal: literal))
}
}
extension CommonTableExpression {
var relationForAll: SQLRelation {
SQLRelation(