Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultExecutorFactory ¶
SetDefaultExecutorFactory overrides the default executor factory (intended for tests).
Types ¶
type Config ¶
type Config struct {
SourceURL string
Store state.Store
Executor executor.Executor
Logger *slog.Logger
DryRun bool
Registry *schema.Registry
// Optional DB parameters to let the SDK build a dedicated migrate driver.
DB *sql.DB
DBDriver string // postgres | mysql | sqlite3
MigrationsTable string
// SkipCloseDB prevents the runner from closing the store/driver when using a shared DB (primarily for sqlite3).
SkipCloseDB bool
}
Config drives construction of a Runner instance.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is the public API surface for applying migrations.
func New ¶
New constructs a Runner using the provided configuration. If Store is nil, an in-memory store is used. If Executor is nil, SuperTokens is used. If Registry is nil, the default schema registry is used.
func NewWithWrappedDatabase ¶ added in v0.2.4
func NewWithWrappedDatabase(cfg Config, driverName string, db *sql.DB, tableName string) (*Runner, error)
NewWithWrappedDatabase builds a migrate driver from the provided *sql.DB and driver name, then constructs a Runner. The driver is built with a dedicated connection so closing the runner will not close the caller's DB pool.
func NewWithWrappedDriver ¶ added in v0.2.4
NewWithWrappedDriver wraps an existing migrate database.Driver and constructs a Runner.