Fix parameter escape in SQLiteDriver #9400
Merged
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 of change
(Re-)Fixes: #1981
The issue in #1981 re-occurred after 0.3.0 because
nativeParameters
became deprecated and newfind
methods useparmeters
instead which where not fixed in #7122. This PR adds the boolean parameter escape for all kind of parameters and also makes additional transformations as implemented in theBetterSqlite3QueryRunner
obsolete.The problem seems to be mainly related to the
CordovaDriver
where I also encountered this problem after migration to > 0.3.0. However, I think it's appropriate to have this fixed in theAbstractSqliteDriver
because it is obviously affectingBetterSqlite3
too and a correct way of handling boolean properties in SQLite anyways :).A similar approach was already submitted via: #9009 which was closed unfortunately but I added test-cases in addition and instead of just converting the boolean values to strings this PR will pass them as numeric query parameters.
Pull-Request Checklist
master
branchnpm run format
to apply prettier formattingnpm run test
passes with this changeFixes #0000