Add support for modifying the identifier delimiter #1061
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.
You can test the changes made in this PR directly, but the actual test suite may be expecting the SQL-92 specific syntax so it may not be able to directly run the tests when the identifier delimiter has been changed since the generated queries likely won't match anymore.
But by default, the changes proposed here should allow the existing test suite to continue to pass without any changes, since it should still be using the double quote identifier delimiter.
Taking input from Medoo#1044, this adds support for users to modify the quote identifier used for their quotes with databases that might not support the assumed SQL-92 standard double quote delimiter for identifiers.
While I think switching databases into the SQL-92 mode is a good approach generally for making maintenance on the Medoo side simpler, so that the code can be generalized more easily, it's not a workable approach in all situations as described in the issue above by the two PlanetScale users that have run into difficulties.
Similarly though, I could see a Microsoft SQL Server user possibly not wanting to do the same and it causing an issue somehow, although this particular situation does appear to be a bit more PlanetScale specific since the ability for the
ANSI_QUOTES
option is not supported at this time, nor does it seem to be something that will readily become available in the near future. We've documented this limitation on our MySQL Compatibility page.Many libraries do allow for the customization of this identifier for their database-specific drivers, but I do understand the Medoo project's desire to keep things as simple and self-contained as possible and I hope the code suggested in this Pull Request is simple enough that it may be considered for users.