mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
_SQLExpression.sql(_:_:) turns all values into safely escaped SQL literals when given nil arguments. (addresses #83)
This commit is contained in:
1 parent
9f7851a178
commit
034a24dfe3
5 files changed
+85
-20
No files matched your search
@@ -25,10 +25,10 @@ extension QueryInterfaceRequest : FetchRequest {
|
||||
@warn_unused_result
|
||||
public func prepare(db: Database) throws -> (SelectStatement, RowAdapter?) {
|
||||
// TODO: split statement generation from arguments building
|
||||
var arguments = StatementArguments()
|
||||
var arguments: StatementArguments? = StatementArguments()
|
||||
let sql = try query.sql(db, &arguments)
|
||||
let statement = try db.selectStatement(sql)
|
||||
try statement.setArgumentsWithValidation(arguments)
|
||||
try statement.setArgumentsWithValidation(arguments!)
|
||||
return (statement, nil)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user