Skip to content

Support mssql json and xml extensions #1043

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

Merged
merged 3 commits into from
Nov 18, 2023
Merged

Support mssql json and xml extensions #1043

merged 3 commits into from
Nov 18, 2023

Conversation

lovasoa
Copy link
Contributor

@lovasoa lovasoa commented Nov 8, 2023

Adds support for SQL syntax like

SELECT * FROM t FOR JSON PATH, ROOT('x'), INCLUDE_NULL_VALUES
SELECT * FROM t FOR XML PATH('x'), ROOT('y'), ELEMENTS

fixes #1042

See the documentation for the FOR clause here: https://learn.microsoft.com/en-us/sql/t-sql/queries/select-for-clause-transact-sql?view=sql-server-ver16

@coveralls
Copy link

coveralls commented Nov 8, 2023

Pull Request Test Coverage Report for Build 6910265870

  • 175 of 184 (95.11%) changed or added relevant lines in 7 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.07%) to 87.715%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/query.rs 52 56 92.86%
src/parser/mod.rs 80 85 94.12%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 5 11.83%
Totals Coverage Status
Change from base Build 6829537554: 0.07%
Covered Lines: 17786
Relevant Lines: 20277

💛 - Coveralls

@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 8, 2023

@alamb : I'd love to get your feedback on this. I'm adding more JSON-related features to SQLPage, and missing json support is blocking for mssql users.

I also added support for the XML syntax while I was at it.

@alamb
Copy link
Contributor

alamb commented Nov 9, 2023

Thanks @lovasoa - I hope to find time to review this over the next few days

@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 17, 2023

@alamb , did you find the time to give a quick look ? I'd like to release a new version of sqlpage with this :)

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @lovasoa

@alamb alamb merged commit 953c833 into apache:main Nov 18, 2023
@lovasoa lovasoa deleted the for_json branch November 18, 2023 12:07
@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 18, 2023

Great, thank you @alamb !

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.

Support MS SQL Server's FOR JSON PATH
3 participants