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

feat: EXPOSED-729 [Oracle] Allow setting limit with DELETE #2403

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

bog-walk
Copy link
Member

Description

Summary of the change: Using Table.delete(limit = #) with Oracle no longer throws unsupported exception.

Detailed description:

  • Why:

Oracle does not support the LIMIT syntax, but it is still possibly to limit the number of rows on which an update or delete operation takes place. This can be done using the ROWNUM pseudocolumn, which is the current implementation for Table.update(limit = #). For some reason, this syntax was never extended to DELETE.

  • How:
    • Extract common string building logic to private function
    • Use the above in delete() instead of throwing

Type of Change

Please mark the relevant options with an "X":

  • Feature - dialect extension

Affected databases:

  • Oracle

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)

Related Issues

EXPOSED-729

It is currently only possibe to set a limit on update() even though the same ROWNUM
syntax that is used for that function provider also applies to delete().

This logic has now been shared across both and tests adjusted.
@bog-walk bog-walk requested a review from e5l February 11, 2025 03:41
@bog-walk bog-walk merged commit ce00bdd into main Feb 12, 2025
7 checks passed
@bog-walk bog-walk deleted the bog-walk/allow-oracle-delete-limit branch February 12, 2025 01:16
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