-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Document single quote escape #19628
Conversation
@@ -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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
Cherry-pick of trinodb/trino@aacdb5e (trinodb/trino#19628) Co-authored-by: Will Morrison <[email protected]>
Cherry-pick of trinodb/trino@aacdb5e (trinodb/trino#19628) Co-authored-by: Will Morrison <[email protected]>
aacdb5e
to
df0f44a
Compare
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
There was a problem hiding this 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.
Cherry-pick of trinodb/trino@aacdb5e (trinodb/trino#19628) Co-authored-by: Will Morrison <[email protected]>
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: