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 SQL Syntax Checker #7777

Open
fm3 opened this issue May 2, 2024 · 1 comment
Open

Add SQL Syntax Checker #7777

fm3 opened this issue May 2, 2024 · 1 comment

Comments

@fm3
Copy link
Member

fm3 commented May 2, 2024

Can we feed our scala sources into a tool like pgsanity or plpgsql lint to find some issues without actually executing the queries?

Hurdles:

  • extract the SQL statements from scala sources (q""-strings)
  • deal with $interpolation (those might not only be values but also parts of the query. can we just replace them by TRUE or something?)
@MichaelBuessemeyer
Copy link
Contributor

My 5ct:

Parsing and looking for q"" should be possible with tree-sitter which also has scala support. Tree sitter makes it easily possible to query a file for q""-strings and from there we should be able to

  1. put it into a validator against our schema
  2. format the query string to support unified query string formatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants