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

support postgres json_object syntax #1545

Closed
lovasoa opened this issue Nov 24, 2024 · 0 comments · Fixed by #1547
Closed

support postgres json_object syntax #1545

lovasoa opened this issue Nov 24, 2024 · 0 comments · Fixed by #1547

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Nov 24, 2024

Postgresql supports the following syntax for the json_object function:

json_object('label' VALUE 'value')
json_object('label': 'value')

Reference: https://www.postgresql.org/docs/current/functions-json.html

Related: the key: value syntax was already implemented for mssql by @gaoqiangz in #1507 . We probably just need to enable it (+ a new VALUE separator) for postgres too

#1506

Initially reported in sqlpage/SQLPage#708

lovasoa added a commit to lovasoa/sqlparser-rs that referenced this issue Nov 24, 2024
This just updates the postgres dialect definition to add support for the json_object syntax added in apache#1507

The syntax was initially added for mssql but also works in postgres

See https://www.postgresql.org/docs/current/functions-json.html

See apache#1545
lovasoa added a commit to lovasoa/sqlparser-rs that referenced this issue Nov 24, 2024
Fixes apache#1545
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 a pull request may close this issue.

1 participant