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(postgres): Ensure that we use the correct JSON sql for delete by ID #816

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

Tehsmash
Copy link
Contributor

@Tehsmash Tehsmash commented Oct 18, 2023

Description

The code in deleteById was not using the SQLVariant logic to switch between the Postgres and SQLite versions of JSON extract and JSON quote this resulted in a 500 error when deleting an object through the API.

This commit switches to use the SQLVariant variable to generate the correct SQL command to query the ID.

Closes #820

Type of Change

[X] Bug Fix
[ ] New Feature
[ ] Breaking Change
[ ] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

The code in deleteById was not using the SQLVariant logic to switch
between the Postgres and SQLite versions of JSON extract and JSON quote
this resulted in a 500 error when deleting an object through the API.

This commit switches to use the SQLVariant variable to generate the
correct SQL command to query the ID.
@Tehsmash Tehsmash requested a review from a team as a code owner October 18, 2023 09:30
@github-actions
Copy link

Hey!

Your images are ready:

  • ghcr.io/openclarity/vmclarity-apiserver-dev:pr816-c5945ca2cc3837025861413304029e134b935053
  • ghcr.io/openclarity/vmclarity-orchestrator-dev:pr816-c5945ca2cc3837025861413304029e134b935053
  • ghcr.io/openclarity/vmclarity-ui-backend-dev:pr816-c5945ca2cc3837025861413304029e134b935053
  • ghcr.io/openclarity/vmclarity-ui-dev:pr816-c5945ca2cc3837025861413304029e134b935053
  • ghcr.io/openclarity/vmclarity-cli-dev:pr816-c5945ca2cc3837025861413304029e134b935053

@Tehsmash Tehsmash added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit a361a24 Oct 18, 2023
33 checks passed
@Tehsmash Tehsmash deleted the fix_delete_postgres branch October 18, 2023 12:16
@chrisgacsal chrisgacsal mentioned this pull request Nov 6, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Failure to delete scan configs when setting postgres
3 participants