Documentation
¶
Index ¶
- func Generate(destDir string, dbConn DBConnection, genTemplate ...template.Template) (err error)
- func GenerateDB(db *sql.DB, schema, destDir string, templates ...template.Template) error
- func GenerateDSN(dsn, schema, destDir string, templates ...template.Template) error
- func ReadSchema(db *sql.DB, schema string) (metadata.Schema, error)
- type DBConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(destDir string, dbConn DBConnection, genTemplate ...template.Template) (err error)
Generate generates jet files at destination dir from database connection details
func GenerateDB ¶
GenerateDB generates jet files using the provided *sql.DB
func GenerateDSN ¶
GenerateDSN generates jet files using dsn connection string
func ReadSchema ¶
ReadSchema reads the metadata of schema from db, as GenerateDB does, and prints nothing. Each base table also carries its unique indexes, its foreign keys and the catalogue type of each column, which GenerateDB does not read. Pass the result to template.Render to generate the files in memory. It needs PostgreSQL: CockroachDB has no array slicing for the index query.
Types ¶
Click to show internal directories.
Click to hide internal directories.