SQL formatter/checker - checks your .sql but doesn't change it.
It's really crude.
You can invoke it with uvx like this ...
uvx --from git+https://github.com/Health-Informatics-UoN/tuff.git tuffYou can clone it and run from that as well ...
git clone https://github.com/Health-Informatics-UoN/tuff.git ~/Documents/tuff
uv --project ~/Documents/tuff run tuffIt needs to be run from a dir with sql/ in it, and it needs npx and uv installed.
My setup is ...
$ ls
README.md sql
$ npx -v
11.17.0
$ uvx -v
DEBUG Searching for user configuration in: `/Users/peter/.config/uv/uv.toml`
DEBUG uv 0.11.19 (7b2cff1c3 2026-06-03 aarch64-apple-darwin)
Provide a command to run with `uvx <command>`.
See `uvx --help` for more information.
$ uvx --from git+https://github.com/Health-Informatics-UoN/tuff.git tuff- run in folder
sql/- will check
sql/cte/*.sqlfor CTEs- run
npx sql-formatteron each; error if it changes them - check CTEs don't have CTEs
- run
- will check all
sql/*.sql- run
npx sql-formatteron each; error if it changes them - check any CTEs match what was above
- run
- will check
- detect usage things
- when the body queries from a CTE name
- when the body defined a CTE name
- sql-fluff linting
- sql-formatter running from python as well
- ... or faster invoke of the npx version
- read/save settings from .vscode file
- pre-commit job
- for folder; allow these non-CTEs, then, verify all queries and CTEs are up to date
- prepare/show "live queries" that replace specific CTEs (so ... sql/cte/live/?)
- convert to a vscode extension