Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithEmbedAndDatabase ¶ added in v0.0.9
func NewWithEmbedAndDatabase(param *EmbedAndDatabaseParam) (*migrate.Migrate, error)
func NewWithScriptsAndSource ¶ added in v0.0.9
func NewWithScriptsAndSource[T database.Driver](param *ScriptsAndSourceParam) (*migrate.Migrate, error)
NewWithScriptsAndSource creates a new migration instance. T must implement database.Driver interface, e.g.:
- sqlite3.Sqlite from "github.com/golang-migrate/migrate/v4/database/sqlite3"
- mysql.Mysql from "github.com/golang-migrate/migrate/v4/database/mysql"
- postgres.Postgres from "github.com/golang-migrate/migrate/v4/database/postgres"
Note: The type param T is used to trigger side effects.
Example:
- migration, err := NewWithScriptsAndSource[*sqlite3.Sqlite](param)
- migration, err := NewWithScriptsAndSource[*mysql.Mysql](param)
- migration, err := NewWithScriptsAndSource[*postgres.Postgres](param)
Types ¶
type EmbedAndDatabaseParam ¶ added in v0.0.9
type ScriptsAndSourceParam ¶ added in v0.0.9
Click to show internal directories.
Click to hide internal directories.