Don't check for ENABLE_UPDATE_DELETE_LIMIT: let SQLite emit syntax errors

This commit is contained in:
Gwendal Roué committed 2019-11-08 18:08:27 +01:00
1 parent 7345c5f2dd
commit cb77fe2ed3
1 file changed
+2 -12
@@ -161,12 +161,7 @@ struct SQLQueryGenerator {
if !orderings.isEmpty {
sql += " ORDER BY " + orderings.map { $0.orderingTermSQL(&context) }.joined(separator: ", ")
}
if Database.sqliteCompileOptions.contains("ENABLE_UPDATE_DELETE_LIMIT") {
sql += " LIMIT " + limit.sql
} else {
fatalError("SQLite was not compiled with the ENABLE_UPDATE_DELETE_LIMIT option: can't delete query with limit")
}
sql += " LIMIT " + limit.sql
}
let statement = try db.makeUpdateStatement(sql: sql)
@@ -223,12 +218,7 @@ struct SQLQueryGenerator {
if !orderings.isEmpty {
sql += " ORDER BY " + orderings.map { $0.orderingTermSQL(&context) }.joined(separator: ", ")
}
if Database.sqliteCompileOptions.contains("ENABLE_UPDATE_DELETE_LIMIT") {
sql += " LIMIT " + limit.sql
} else {
fatalError("SQLite was not compiled with the ENABLE_UPDATE_DELETE_LIMIT option: can't update query with limit")
}
sql += " LIMIT " + limit.sql
}
let statement = try db.makeUpdateStatement(sql: sql)