apache / apache/datafusion-sqlparser-rs
Add support for LIMIT prepared query
- 主要語言
- Rust
- 星號
- 3.5k
- 分支
- 772
- 平均合併
- 4 天 9 小時
- 30 天內合併 PR
- 17
描述
Hi, I am using sqlparser 0.4.0 and rust version 1.36.0
Sql Query
`
SELECT "emp"."id" FROM "emp" WHERE "emp"."id" = $1 LIMIT $2 -- binds: [123, 5]
`
Parse error
`
ParserError("Expected literal int, found: $2")
`
Used Dialect:
```rust
impl Dialect for AckoPostgresSqlDialect {
fn is_identifier_start(&self, ch: char) -> bool {
(ch >= 'a' && ch <= 'z')
|| (ch >= 'A' && ch <= 'Z')
|| (ch == '@')
|| ch == '$'
|| ch == '_'
}
fn is_identifier_part(&self, ch: char) -> bool {
(ch >= 'a' && ch <= 'z')
|| (ch >= 'A' && ch <= 'Z')
|| (ch >= '0' && ch <= '9')
|| (ch == '@')
|| ch == '$'
|| ch == '_'
}
}
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從所示查詢的 LIMIT 解析路徑著手,檢查 $2 在提供的 AckoPostgresSqlDialect 下是如何分類的。為 LIMIT 中的預處理參數加入支援,然後驗證範例查詢是否能使用 binds [123, 5] 成功解析。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust, sql
- 領域
- compilers
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100