JetBrains / Exposed

Kotlin SQL Framework
http://jetbrains.github.io/Exposed/
Apache License 2.0
8.05k stars 676 forks source link

fix: EXPOSED-307 [SQLite] Delete ignore not supported and throws #2021

Closed bog-walk closed 4 months ago

bog-walk commented 4 months ago

Attempting to use deleteIgnoreWhere() with SQLite results in:

SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "OR": syntax error)

SQLiteDialect is currently setup to generate this SQL even though DELETE IGNORE is not supported:

DELETE OR IGNORE FROM Cities WHERE Cities.cityId = 1

DELETE IGNORE is only supported by MySQL and MariaDB and no test exists for it, so it's been added to the base delete tests. SQLite now fails early, like all other DB, with UnsupportedByDialectException if ignore is set to true.