refactor: EXPOSED-728 [SQLite] Remove ENABLE_UPDATE_DELETE_LIMIT metadata check from core function provider #2402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change: Deprecate
SQLiteDialect.ENABLE_UPDATE_DELETE_LIMIT
and replace with metadata functions that perform the same query, but which can be extracted into separate modules when R2DBC is introduced.Detailed description:
SQLiteDialect
has a companion property that sends a low-level JDBC connection query to check ifLIMIT
clause is allowed in either update or delete statements. The latter is only possible if SQLite is built from the source with the compile-time flagENABLE_UPDATE_DELETE_LIMIT
enabled (source docs).In preparation for R2DBC, this query needs to be removed from
exposed-core
so that it can be implemented in both a blocking and non-blocking way.FunctionProvider
is not expected to have jdbc vs r2dbc versions. So the metadata check is instead placed inExposedDatabaseMetadata
and invoked inupdate()
anddelete()
directly, since they will all be extracted to their respective modules.This was missed from previous refactors because it doesn't use
exec()
.SQLiteDialect.ENABLE_UPDATE_DELETE_LIMIT
DatabaseDialect.supportsLimitWithUpdateOrDelete()
, which callsExposedDatabaseMetadata.supportsLimitWithUpdateOrDelete()
to send the same query with SQLite. All other dialects are hard-coded with a boolean value.SQLiteDialect
's function provider and place directly inTable.update()
andTable.delete
variants.Type of Change
Please mark the relevant options with an "X":
Affected databases:
Checklist
Related Issues
EXPOSED-728