Documentation
¶
Overview ¶
Command jetgen writes Jet table builders and models for a schema file. It creates a scratch database on the server, runs the file there, generates from it and drops it again, so no migrated database has to exist.
go run ./scripts/jetgen -schema schema.sql -dest internal/db/jet go run ./scripts/jetgen -schema example/db/schema.sql -dest example/db/jet -db-tags
Without -db-tags the models are Jet's defaults (no db tags, string for jsonb), which is what the admin's own tables use and so what the tests of a default model run against. With it every field carries a `db:"column"` tag and jsonb is json.RawMessage, as in a generator tuned for pgx.
It drives Jet's generator as a library rather than through the jet command, which links the cgo SQLite driver.
Click to show internal directories.
Click to hide internal directories.