4 ms·
I can't wait for this. Just getting out a great AST would be amazing for things like formatters, but I want to build things like a library that knows everywhere
by netcraft 3y ago
I can't wait for this. Just getting out a great AST would be amazing for things like formatters, but I want to build things like a library that knows everywhere you use a table in a particular way or reference a column, or linting that can help you identify problems with the way you do a join or forgot to apply the right filter for multi-tenant queries.
- steinroe 3y agothat is definitely the goal, both a formatter and a linter. we want to add something like squawk and plpgsql_check directly to the language server, so you get eslint-like dx. with both the ast and the database schema at hand, you can basically add any rule you like. and this is far out, but eventually we are maybe even able to combine the language server with declarative schema management and have go-to-definition etc working. [0] https://github.com/sbdchd/squawk/tree/master https://github.com/sbdchd/squawk/tree/master [1] https://github.com/okbob/plpgsql_check https://github.com/okbob/plpgsql_check
- mhh__ 3y agoFor a formatter you only need tokens and rules. ASTs are unnecessary unless you want to do transformations at the same time.