Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eopo
Copy link
Collaborator

@eopo eopo commented Apr 14, 2025

Description

We relied a lot on JavaScript control structures depending on the dbtype, to manually choose the right quotes for our queries. Knex offers some convenience functions like "db.ref()" and Query Bindings, that should automatically choose the right quotes depending on the used database adapter.

This should fix issues where wrong quotes lead to errors like #628 and make our code slightly slimmer and less error prone - although there's a LOT room for improvement

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • CI-Tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated changelog.md with changes made

…venience functions for quote choosing, should fix #628
@eopo eopo changed the title Fix #628 - DB Query Quotes Hotfix: DB Query Quotes Apr 14, 2025
@DanrwAU
Copy link
Member

DanrwAU commented Apr 20, 2025

I don't think 860 lines is really a "hotfix" it's rebuilding a significant amount of key code. My preference is this goes on top of develop and is tested holistically with develop once merged..

Also need to be very careful with knex/sqlite/mysql version changes, this has caused us significant issues in the past breaking backwards compatibility.

@eopo
Copy link
Collaborator Author

eopo commented Apr 20, 2025

I don't think 860 lines is really a "hotfix" it's rebuilding a significant amount of key code.

Nope, most of the changed lines are linting in files that were edited.

My preference is this goes on top of develop and is tested holistically with develop once merged..

If we want to release 0.4 somewhat soon i'm fine with that. The last release is over 2 years old, so I want bugs to be fixed without waiting another year.

Also need to be very careful with knex/sqlite/mysql version changes, this has caused us significant issues in the past breaking backwards compatibility.

Should not be a big problem, because with sqlite3, the actual sqlite3 "server" is included in the npm package, so the compatibility between node package and db file are actually working. We could implement some tests with opening up really old databases though to ensure that they will be processed by the new package.

@eopo eopo force-pushed the hotfix_dbqueries branch from c5e8186 to dc460ad Compare April 24, 2025 09:12
@eopo
Copy link
Collaborator Author

eopo commented Apr 24, 2025

Reduced to really only fix the quoting error and nothing else. Tests fail because of index route error, whose fix is now removed from this branch and added in #635

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.

When using Digital Ocean managed databases a ER_BAD_FIELD_ERROR is recieved

3 participants