This booktest directory contains the canonical dbtpl example demonstrate an
end-to-end use of dbtpl. Generates code from a simple schema and custom query
for each database. Additionally, showcases a practical use of generated Go
code.
This examples are also used by the dbtpl developers to compare generated code
for/between databases and template revisions.
Contained in this directory is a subdirectory for each supported <database>
by dbtpl:
| Database | Generated Code |
|---|---|
| Microsoft SQL Server | sqlserver |
| MySQL | mysql |
| Oracle | oracle |
| PostgreSQL | postgres |
| SQLite3 | sqlite3 |
Each database has a sql/<name>_schema.sql and sql/<name>_query.sql
containing a basic authors and books schema, and a custom retrieval query
the database.
See gen.sh to see how the various database model code was
generated.