apache / apache/datafusion-sqlparser-rs

Carry exact expected statement type in `ParserError`

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

描述

Currently `sqlparser-rs` return a `&str` to tell which type of token parser is expecting:
``` rust
fn expected(&self, expected: &str, found: Token) -> Result
```

When a SQL string is not completed.
Return an exact `ExpectType` will be better, this can deliver help for developing tools like SQL complete tools etc.
``` rust
fn expected(&self, expected: Vec, found: Token) -> Result
```

贡献指南

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

调研方向

首先定位 ParserError 的实现以及 issue 中描述的预期函数,然后检查不完整 SQL 的解析方式。定义 ExpectType 值必须表示的内容,并验证 SQL 补全工具能够保留精确的预期结果,同时覆盖不完整语句。

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

评估

技术栈
rust
领域
compilers
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

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