apache / apache/datafusion-sqlparser-rs

Allow to override all the `parser..` methods.

未关闭
#1,415 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
17

描述

We are building a new RDBMS that still has only partial support for the full `SQL` dialect of Postgres.

This means that we need to parse the strings, and then rule out everything we still do not support. It will be easier and probably faster if we can do:

```rust
// As is possible here
pub fn parse_statement(&mut self) -> Result {
let _guard = self.recursion_counter.try_decrease()?;

// allow the dialect to override statement parsing
if let Some(statement) = self.dialect.parse_statement(self) {
return statement;
}
....
}

// Make at least the major components overridable:
pub fn parse_table_and_joins(&mut self) -> Result {
if let Some(result) = self.dialect.parse_table_and_joins(self) {
return result;
}
...
...
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 issue 中显示的现有 parse_statement override 开始,然后检查 parse_table_and_joins 和 dialect interface,以确定 parser methods 的分发方式。定义应可被 override 的完整方法集合,并验证在 dialect 可以拦截这些 entry points 的同时,受支持的 parsing 仍能正常工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
postgresql, rust, sql
领域
databases
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
32/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。