Installation¶
db-gen ships as a single self-contained executable. There is no installer and no runtime dependency.
Download a release¶
Grab the latest db-gen-win.exe (Windows) or db-gen-linux (Linux) from the Releases page.
Commit the binary into your repo
We recommend committing the binary next to your code. Yes, the repository gets bigger — but in five years, when you need to regenerate, it will still be there and still produce identical output. You can also run db-gen generate as part of CI/CD.
Build from source¶
Requires Go 1.21+.
Verify¶
Shell completion (optional)¶
db-gen can emit a completion script for your shell:
What you need to run it¶
- A PostgreSQL database (or an exported routines JSON file for offline generation).
- A configuration file — see Configuration.
- One or more templates — see Templating.
Next: Quick Start.