Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

bog-walk
Copy link
Member

@bog-walk bog-walk commented Mar 3, 2024

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.

…ax exception

Attempting to use deleteIgnoreWhere() with SQLite throws a syntax exception because
SQL is being generated even though MySQL and MariaDB are the only databases that
support some variant of DELETE IGNORE.

This adds a unit test for deleteIgnoreWhere() and ensures that it also fails early
when used with SQLite.
@bog-walk bog-walk requested review from e5l and joc-a March 3, 2024 17:16
@bog-walk bog-walk merged commit 9abd401 into main Mar 4, 2024
5 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-delete-ignore branch March 4, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants