Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a database connection and migration data.
func New ¶
func New(dsn string, migrations *Migrations) (*Database, error)
New creates a new database instance with a DSN string and migrations.
func NewWithConn ¶
func NewWithConn(conn *sql.DB, migrations *Migrations) *Database
NewWithConn creates a new database instance with a database connection and migrations.
func (*Database) CurrentVersion ¶
CurrentVersion returns the current version of the database.
func (*Database) MigrateDown ¶
MigrateDown migrates the database down by the specified amount.
func (*Database) MigrateUp ¶
MigrateUp migrates the database up to the current version (highest version).
func (*Database) SetMigrationTable ¶
SetMigrationTable sets the name of the migration table.
Click to show internal directories.
Click to hide internal directories.