SQL Style programming sql
I have spent many keystrokes, hundreds of thousands perhaps, formatting SQL.
I've gone back on forth on whether I like the river-flow or indenting; now I indent.
Black/ruff/etc have all but taken away any manual formatting I do in Python, but SQL lacks a community supported options that is so easy to use.
Diff tool difftastic works by using tree-sitter to parse code.
We can use tree-sitter to parse SQL. Here's one implementation: https://github.com/DerekStride/tree-sitter-sql
My half-baked project is here: https://github.com/andyreagan/brown
I've since learned that we could probably use Postgres's parser here as well, since that part of their code is separate.