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

Use JSON-style string escaping #352

Merged
merged 1 commit into from
Aug 9, 2021
Merged

Conversation

brantburnett
Copy link
Collaborator

Motivation

The current approach to string escaping causes problems if a backslash
is included, and also can't handle special characters like tab or CR.

Modifications

Serialize string and character constants to the N1QL query using a JSON
serializer.

Also change some other locations rendering strings to use double quotes
for consistency.

Results

String and character constant expressions now support the full set of
characters supported by JSON.

Strings now appear on the query wrapped in double quotes instead of
single quotes.

Fixes #348

Motivation
----------
The current approach to string escaping causes problems if a backslash
is included, and also can't handle special characters like tab or CR.

Modifications
-------------
Serialize string and character constants to the N1QL query using a JSON
serializer.

Also change some other locations rendering strings to use double quotes
for consistency.

Results
-------
String and character constant expressions now support the full set of
characters supported by JSON.

Strings now appear on the query wrapped in double quotes instead of
single quotes.

Fixes #348
@jeffrymorris jeffrymorris merged commit bbd3743 into master Aug 9, 2021
@jeffrymorris
Copy link
Contributor

Thanks Brant!

@brantburnett brantburnett deleted the issue-348-string-escaping branch August 11, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ParsingFailureExceptions thrown when creating brewery_id index in Couchbase.Linq.IntegrationTests
2 participants