migrate

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package migrate applies the embedded dbmate migrations to a database on startup, so the gateway stays a single self-contained binary. Migrations are split by dialect (sqlite, postgres) since the schema SQL differs.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SQLite uses migrations/sqlite and "?" placeholders.
	SQLite = Dialect{/* contains filtered or unexported fields */}
	// Postgres uses migrations/postgres and "$1" placeholders.
	Postgres = Dialect{/* contains filtered or unexported fields */}
)

Functions

func Run

func Run(conn *sql.DB, d Dialect) error

Run applies any not-yet-applied migrations for the dialect in version order. It is safe to call on every startup; already-applied migrations are skipped.

Types

type Dialect

type Dialect struct {
	// contains filtered or unexported fields
}

Dialect names the migration set and the placeholder style to apply.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL