Documentation
¶
Overview ¶
Package authkitmigrate applies AuthKit's embedded Postgres migrations from host code, mirroring rivermigrate's shape:
migrator := authkitmigrate.New(pool, &authkitmigrate.Config{Schema: cfg.Schema})
res, err := migrator.Migrate(ctx)
It is up-only (AuthKit ships no down migrations) and idempotent: tracking is name-based in public.migrations under the canonical "authkit" app key via migratekit, advisory-locked so concurrent replicas are safe. A non-default schema is stamped into the tracking rows, so multiple apps may embed AuthKit in the same database under different schemas without colliding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Schema is the Postgres schema AuthKit's tables live in; it must match
// embedded.Config.Schema. Empty defaults to "profiles".
Schema string
}
Config configures a Migrator.
type MigrateResult ¶
type MigrateResult struct {
// Applied is the migration names applied by THIS call, in order; empty
// when the database was already current.
Applied []string
}
MigrateResult reports what a Migrate call did.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator applies AuthKit's Postgres migrations. Construct with New.
func New ¶
New returns a Migrator over the same pool the host passes to embedded.New. A nil config targets the default "profiles" schema.