Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verbose options to both python and javascript target to include query and approximate position of the error. #2

Closed
surister opened this issue Apr 15, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request javascript About the Javascript package python About the Python package

Comments

@surister
Copy link
Collaborator

surister commented Apr 15, 2024

From crate/crate#15826

Steps:

  • Implement a new ErrorListener that displays the query with the offending token marked both in javascript and python targets.
  • Add the Error to every parsed statement. An error could be an object with the following properties:
{
   "error": "ParseError",
   "original_query": '...",
   "original_query_with_offending_token": "...",
   "offending_token": "...",
   "error_message": "...",
   "col": 1,
   "line": 1
}

We should be able to disable this by:

sqlparse('SELECT 1;', raise_exception=True)

Missing: Javascript target

@surister surister added the enhancement New feature or request label Apr 15, 2024
@surister surister changed the title Add verbose options to both python and javascript target to display verbose syntax errors. Add verbose options to both python and javascript target to include query and approximate position of the error. Apr 16, 2024
@amotl amotl added python About the Python package javascript About the Javascript package labels May 27, 2024
@surister surister self-assigned this Jun 4, 2024
@surister surister closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript About the Javascript package python About the Python package
Projects
None yet
Development

No branches or pull requests

2 participants