SQLGenerationContext no longer needs to be mutated

This commit is contained in:
Gwendal Roué committed 2020-04-29 21:59:04 +02:00
1 parent e47a584c3e
commit a15233eff1
19 files changed
+140 -141

No files matched your search

+3 -3
View File
@@ -9,7 +9,7 @@ public protocol SQLCollection {
/// [**Experimental**](http://github.com/groue/GRDB.swift#what-are-experimental-features)
///
/// Returns an SQL string that represents the collection.
func collectionSQL(_ context: inout SQLGenerationContext) throws -> String
func collectionSQL(_ context: SQLGenerationContext) throws -> String
/// [**Experimental**](http://github.com/groue/GRDB.swift#what-are-experimental-features)
///
@@ -44,9 +44,9 @@ struct SQLExpressionsArray: SQLCollection {
self.expressions = expressions.map(\.sqlExpression)
}
func collectionSQL(_ context: inout SQLGenerationContext) throws -> String {
func collectionSQL(_ context: SQLGenerationContext) throws -> String {
try expressions
.map { try $0.expressionSQL(&context, wrappedInParenthesis: false) }
.map { try $0.expressionSQL(context, wrappedInParenthesis: false) }
.joined(separator: ", ")
}