Documentation ¶
Index ¶
Constants ¶
View Source
const CreateMigrationTable string = `
CREATE TABLE IF NOT EXISTS migration (
name TEXT NOT NULL PRIMARY KEY,
created_at INTEGER NOT NULL
);
`
View Source
const DeleteMigrationEntry string = `
DELETE FROM migration WHERE name = ?
`
View Source
const FindMigrationEntry string = `
SELECT name FROM migration WHERE name = ?
`
View Source
const NewMigrationEntry string = `
INSERT INTO migration (name, created_at) VALUES (?, ?)
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func GetDatabase ¶
func GetDatabase() *Database
func NewDatabase ¶
func (*Database) RevertMigrations ¶
func (*Database) RunMigrations ¶
type SQLMigration ¶
type SQLMigration struct {
// contains filtered or unexported fields
}
func NewSQLMigration ¶
func NewSQLMigration(name string, upQuery string, downQuery string) SQLMigration
type SQLite ¶
func (*SQLite) AddMigration ¶
func (s *SQLite) AddMigration(migration ...SQLMigration)
func (*SQLite) Migrations ¶
func (s *SQLite) Migrations() []SQLMigration
func (*SQLite) RevertMigrations ¶
func (*SQLite) RunMigrations ¶
Click to show internal directories.
Click to hide internal directories.