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

Document single quote escape #19628

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

willmostly
Copy link
Contributor

Description

This adds an example of how to escape single quotes in string literals.

Additional context and related issues

Release notes

( x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Nov 3, 2023
@github-actions github-actions bot added the docs label Nov 3, 2023
@@ -155,6 +155,9 @@ before any Unicode character usage with 4 digits. In the examples above
with 6 digits require usage of the plus symbol before the code. For example,
you need to use `\+01F600` for a grinning face emoji.

Single quotes in string literals can be escaped by using another single quote:
Copy link
Member

@mosabua mosabua Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While true as it stands.. I am not sure this is the correct spot in the docs .. it also applies to char at least .. lets see what @martint thinks .. personally I think here is fine but we also should copy down into the char section .. and others if ncecessary

We also might want to mention using double quotes for identifiers somewhere .. unless we do already

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifiers were covered in #18181
When working on that we decided not to have a separate page for generic sql syntax and put all literals descriptions here in data types. I agree we might mention this in chars too, but that should be it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well, maybe also in the query table function docs. Some people asked about it in the Trino slack, how to escape quotes around literals in query "parameters"

Akanksha-kedia added a commit to Akanksha-kedia/prestodb that referenced this pull request Nov 8, 2023
tdcmeehan pushed a commit to prestodb/presto that referenced this pull request Nov 8, 2023
@willmostly willmostly force-pushed the will/doc_quote_escape branch from aacdb5e to df0f44a Compare November 29, 2023 17:31
Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Jan 10, 2024
Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's ok to discuss if there's a better place to move this information for now this is still useful and answers a question a lot of people have.

Merging.

@hashhar hashhar merged commit 4d51ff4 into trinodb:master Jan 10, 2024
9 checks passed
@github-actions github-actions bot added this to the 436 milestone Jan 10, 2024
kaikalur pushed a commit to kaikalur/presto that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants