apache / apache/datafusion-sqlparser-rs

Carry exact expected statement type in `ParserError`

Open
#437 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.5k
Forks
772
Avg merge
4d 9h
Merged PRs (30d)
17

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the ParserError implementation and the expected function described in the issue, then inspect how incomplete SQL is parsed. Define what ExpectType values must represent and verify that exact expectations are preserved for SQL completion tooling, with coverage for incomplete statements.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.