apache / datafusion-sqlparser-rs

Extensible SQL Lexer and Parser for Rust
Apache License 2.0
2.79k stars 537 forks source link

support for mssql `json_object` syntax #1506

Open lovasoa opened 4 days ago

lovasoa commented 4 days ago

SQL server has a json_object function with a special syntax that uses colons instead of commas between json keys and values.

SELECT JSON_OBJECT('name':'value', 'type':1)

This is not yet supported in sqlparser. This would be useful in SQLPage where we use json for advanced features.

Reference: https://learn.microsoft.com/en-us/sql/t-sql/functions/json-object-transact-sql?view=sql-server-ver16

@gaoqiangz this may be of interest to you :)

gaoqiangz commented 3 days ago

👌