Documentation
¶
Overview ¶
Package sqlmigrate applies a service's embedded migration files to a database/sql handle, so a service's store directory holds its .sql files and nothing else: the files are the only schema source, and this is the one runner that reads them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply brings db up to every *.up.sql file under dir in files, in name order, skipping the ones schema_migrations already records. Each file is executed one statement at a time so a driver that runs one statement per call (candace/pkg/pgmem in tests) applies the same bytes production does.
func ApplyPrefixed ¶
ApplyPrefixed applies a component schema while namespacing its migration receipts in a database shared with an owning application. Prefix is only a ledger namespace; it never changes the embedded filename or execution order.
func Statements ¶
Statements splits one migration file into the statements it holds. The files hold plain DDL with no semicolons inside literals. Full-line -- comments are removed before semicolons are interpreted as delimiters.
Types ¶
This section is empty.