webknossos
webknossos copied to clipboard
Add SQL Syntax Checker
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?)
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
- put it into a validator against our schema
- format the query string to support unified query string formatting