Inspired by .http files and HTTPYac, SQLYac lets you write executable SQL documentation with variables, safety prompts, and per-query targeting. Instead of scattered .sql files or copy-pasting into clients, write annotated queries once and pipe them to any sql database client. Variables get substituted, destructive queries can prompt for confirmation, and your schema stays documented alongside actual queries. For example, if you have a `queries.sql` file like this:
You can execute a query in the terminal like this: `sqlyac queries.sql QueryWithVariables | mysql -u user -p database` (or `psql`, `sqlite3` or whatever)Written in go, `go install github.com/kalli/sqlyac@latest` for a small-ish binary: https://github.com/kalli/sqlyac Blogpost with more info: https://dev.karltryggvason.com/sqlyac-structure-and-tooling-... |