apache / datafusion-sqlparser-rs

Extensible SQL Lexer and Parser for Rust
Apache License 2.0
2.8k stars 543 forks source link

support for mssql `json_object` syntax #1506

Open lovasoa opened 1 week ago

lovasoa commented 1 week 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 1 week ago

👌