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

Remove initial $ PathSegment from JsonScalarExpression/JsonQueryExpression #30747

Closed
roji opened this issue Apr 24, 2023 · 0 comments · Fixed by #30763
Closed

Remove initial $ PathSegment from JsonScalarExpression/JsonQueryExpression #30747

roji opened this issue Apr 24, 2023 · 0 comments · Fixed by #30763
Assignees
Labels
area-json area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Apr 24, 2023

In JsonScalarExpression and JsonQueryExpression, we currently have an initial $ path segment. While JSONPATH expressions do indeed start with $, that's a specific detail of JSONPATH, and therefore SQL generation; the expression itself shouldn't contain it. For example, PostgreSQL doesn't use JSONPATH at all to drill into JSON documents, and SQLite has a simplified non-JSONPATH syntax when there's only one path segment (e.g. `JsonColumn ->> 'foo').

In addition, we shouldn't produce empty Json{Scalar,Query}Expression (which we then ignore in SQL generation). The code creating these expressions should simply not create them when there's no path.

See #30745 (comment)

roji added a commit to roji/efcore that referenced this issue Apr 25, 2023
And handle it in query SQL generation.

Closes dotnet#30747
@roji roji assigned roji and unassigned maumar Apr 25, 2023
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 25, 2023
roji added a commit to roji/efcore that referenced this issue Apr 25, 2023
And handle it in query SQL generation.

Closes dotnet#30747
@roji roji added this to the 8.0.0 milestone Apr 25, 2023
roji added a commit to roji/efcore that referenced this issue Apr 26, 2023
And handle it in query SQL generation.

Closes dotnet#30747
@ghost ghost closed this as completed in #30763 Apr 26, 2023
ghost pushed a commit that referenced this issue Apr 26, 2023
And handle it in query SQL generation.

Closes #30747
@ajcvickers ajcvickers modified the milestones: 8.0.0-preview5, 8.0.0 Nov 14, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-json area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants