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 sqlite driver using double quotes for string literals #6840

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

rasteiner
Copy link
Contributor

@rasteiner rasteiner commented Dec 6, 2024

Description

Fix the table discovery query in the sqlite class using double quotes for string literals.

Summary of changes

Reasoning

Double quotes to enclose string literals are sometimes supported by sqlite configurations (mainly for backwards compatibility).
Single quotes are always supported.

Additional context

https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted

Changelog

Breaking changes

None

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@rasteiner rasteiner changed the title Fix/sqlite-quotes Fix sqlite driver using double quotes for string literals Dec 6, 2024
@rasteiner
Copy link
Contributor Author

PS: the tests actually pass, I think they timed out here :/

@afbora
Copy link
Member

afbora commented Dec 6, 2024

@rasteiner Thank you for the PR. I've re-run the tests and all passed 🎉

I'm just curious about the Sqlite::quoteIdentifier() method. This method also uses double-quotes. Does this method also need to be updated?

@rasteiner
Copy link
Contributor Author

The quoteIdentifier function is fine, as it correctly puts the quotes around identifiers, such as table or column names and not around string literals.

@bastianallgeier bastianallgeier added this to the 4.6.0 milestone Dec 17, 2024
@bastianallgeier bastianallgeier merged commit 1ff819d into getkirby:develop-patch Dec 17, 2024
7 checks passed
@bastianallgeier
Copy link
Member

Thanks for the PR!

@rasteiner rasteiner deleted the fix/sqlite-quotes branch December 18, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants