From cb77fe2ed35faa71aaa3d4e5dd2253ddebda84a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Fri, 8 Nov 2019 18:08:27 +0100 Subject: [PATCH] Don't check for ENABLE_UPDATE_DELETE_LIMIT: let SQLite emit syntax errors --- .../SQLGeneration/SQLQueryGenerator.swift | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift b/GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift index d05f0d73a..dcf3f9957 100644 --- a/GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift +++ b/GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift @@ -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)