apache / apache/datafusion-sqlparser-rs
Support PostgreSQL json_to_record / jsonb_to_record syntax
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 772
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 17
描述
### Current state:
`PostgreSQL` `json_to_record` / `jsonb_to_record` syntax raises a `ParseError`:
```
use sqlparser::dialect::PostgreSqlDialect;
use sqlparser::parser::Parser;
fn main() {
let sql = r#"select * from json_to_record('{"a":1,"b":[1,2,3],"c":[1,2,3],"e":"bar"}') as x(a int, b text, c int[], d text);"#;
let dialect = PostgreSqlDialect {};
let ast = Parser::parse_sql(&dialect, sql).unwrap();
println!("AST: {:?}", ast);
}
```
### Future state:
`json_to_record` / `jsonb_to_record` syntax supported.
### Additional:
As per [the postgresql docs](https://www.postgresql.org/docs/16/functions-json.html) - search for json_to_record (no deep link)
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先使用 PostgreSqlDialect 重现 SQL 示例,并查阅 PostgreSQL 关于 json_to_record 和 jsonb_to_record 的文档。完成的标准是两种形式都能成功解析,而不是引发 ParseError,包括示例中所示的列定义列表。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, rust
- 领域
- databases
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100