Documentation
¶
Overview ¶
Package migrations embeds the kit's SQL schema, one file set per dialect. Both dialects define the identical table/constraint set (R7); migrations_test cross-checks them against each other and against the storage package's Go enum sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FS embed.FS
FS holds the embedded migration files, laid out as <dialect>/<NNNN>_<name>.sql.
Functions ¶
func Apply ¶
Apply runs every pending migration for the dialect inside one transaction per file, tracking applied files in schema_migrations. It returns the names it applied. Callers pass an already-open *sql.DB (the driver registration lives in storage/sqlite and storage/postgres).
func Files ¶
Files returns the dialect's migration file names in apply order (lexicographic — files are NNNN-prefixed).
func Statements ¶
Statements splits migration SQL into single executable statements so both drivers apply them one Exec per statement (pgx extended protocol rejects multi-statement strings). Migration files therefore must not contain ';' inside string literals or comments; TestStatementsRoundTrip enforces the split is lossless for the embedded files.