Use rawSQL as parameter name for raw SQL

This commit is contained in:
Gwendal Roué committed 2019-02-17 13:28:40 +01:00
1 parent 85f618e16e
commit 4bd5ace2ee
21 files changed
+200 -200

No files matched your search

+3 -3
View File
@@ -418,7 +418,7 @@ public final class TableDefinition {
public func check(sql: String) {
// We do not want to wrap the SQL snippet inside parentheses around the
// checked SQL. This is why we use the "unsafeLiteral" initializer.
checkConstraints.append(SQLExpressionLiteral(unsafeLiteral: SQLLiteral(sql: sql)))
checkConstraints.append(SQLExpressionLiteral(unsafeLiteral: SQLLiteral(rawSQL: sql)))
}
fileprivate func sql(_ db: Database) throws -> String {
@@ -723,7 +723,7 @@ public final class ColumnDefinition {
public func check(sql: String) -> Self {
// We do not want to wrap the SQL snippet inside parentheses around the
// checked SQL. This is why we use the "unsafeLiteral" initializer.
checkConstraints.append(SQLExpressionLiteral(unsafeLiteral: SQLLiteral(sql: sql)))
checkConstraints.append(SQLExpressionLiteral(unsafeLiteral: SQLLiteral(rawSQL: sql)))
return self
}
@@ -757,7 +757,7 @@ public final class ColumnDefinition {
public func defaults(sql: String) -> Self {
// We do not want to wrap the SQL snippet inside parentheses around the
// checked SQL. This is why we use the "unsafeLiteral" initializer.
defaultExpression = SQLExpressionLiteral(unsafeLiteral: SQLLiteral(sql: sql))
defaultExpression = SQLExpressionLiteral(unsafeLiteral: SQLLiteral(rawSQL: sql))
return self
}