dbtpl is a command-line tool that connects to PostgreSQL, MySQL, Oracle, Microsoft SQL Server, and SQLite databases to generate Go code. It inspects your database schema or a custom query and outputs templated Go code, schema creation scripts, JSON/YAML definitions, or Graphviz diagrams. While it produces production-quality code, it's intended to complement, not entirely replace, manual coding.
Generate idiomatic Go code from SQL database schemas and queries.
Go developers working with SQL databases who want to automate the generation of boilerplate data access code.