SQLString everywhere

This commit is contained in:
Gwendal Roué committed 2019-02-17 13:24:38 +01:00
1 parent f27a1e9504
commit 09e85ba341
13 files changed
+186 -103

No files matched your search

+6 -8
View File
@@ -26,23 +26,21 @@ public protocol SQLSelectable {
// MARK: - SQLSelectionLiteral
struct SQLSelectionLiteral : SQLSelectable {
private let sql: String
private let arguments: StatementArguments
private let sqlString: SQLString
init(sqlString: SQLString) {
self.sql = sqlString.sql
self.arguments = sqlString.arguments
init(_ sqlString: SQLString) {
self.sqlString = sqlString
}
func resultColumnSQL(_ context: inout SQLGenerationContext) -> String {
if !arguments.isEmpty {
if context.appendArguments(arguments) == false {
if !sqlString.arguments.isEmpty {
if context.appendArguments(sqlString.arguments) == false {
// GRDB limitation: we don't know how to look for `?` in sql and
// replace them with with literals.
fatalError("Not implemented")
}
}
return sql
return sqlString.sql
}
func countedSQL(_ context: inout SQLGenerationContext) -> String {