env

package
v0.0.0-...-d36ff20 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(url string, migrations_dir string, migrations_table string) error

func Create

func Create() string

func Drop

func Drop() string

func Dump

func Dump(url string, schema_file string) error

func Load

func Load(url string, schema_file string) error

func Migrate

func Migrate(url string, migrations_dir string, migrations_table string) error

func New

func New(migrations_dir string, name string) error

func Reset

func Reset(url string, migrations_dir string, migrations_table string) error

func Rollback

func Rollback(url string, migrations_table string) error

func Status

func Status(url string, migrations_dir string, migrations_table string) error

Types

type DM8

type DM8 struct {
}

func (*DM8) All

func (p *DM8) All() string

func (*DM8) ByVersion

func (p *DM8) ByVersion() string

func (*DM8) CreateSchemaMigrationsTable

func (p *DM8) CreateSchemaMigrationsTable() string

func (*DM8) Down

func (p *DM8) Down() string

func (*DM8) DropSchemaMigrationsTable

func (p *DM8) DropSchemaMigrationsTable() string

func (*DM8) HibernateSequence

func (p *DM8) HibernateSequence() (string, string)

func (*DM8) Insert

func (p *DM8) Insert() string

func (*DM8) Latest

func (p *DM8) Latest() string

func (*DM8) Up

func (p *DM8) Up() string

func (*DM8) Version

func (p *DM8) Version() string

type Database

type Database interface {
	Version() string
	CreateSchemaMigrationsTable() string
	DropSchemaMigrationsTable() string
	HibernateSequence() (string, string)
	ByVersion() string
	Insert() string
	Up() string
	Down() string
	All() string
	Latest() string
}

func Open

func Open(url string) (Database, *sql.DB, error)

type Migration

type Migration struct {
	Up      string
	Down    string
	Name    string
	Version string
	RunAt   *time.Time
}

func (*Migration) Migrate

func (p *Migration) Migrate(tx *sql.Tx, driver Database, migrations_table string) error

func (*Migration) Rollback

func (p *Migration) Rollback(tx *sql.Tx, driver Database, migrations_table string) error

type MySql

type MySql struct {
}

func (*MySql) All

func (p *MySql) All() string

func (*MySql) ByVersion

func (p *MySql) ByVersion() string

func (*MySql) CreateSchemaMigrationsTable

func (p *MySql) CreateSchemaMigrationsTable() string

func (*MySql) Down

func (p *MySql) Down() string

func (*MySql) DropSchemaMigrationsTable

func (p *MySql) DropSchemaMigrationsTable() string

func (*MySql) HibernateSequence

func (p *MySql) HibernateSequence() (string, string)

func (*MySql) Insert

func (p *MySql) Insert() string

func (*MySql) Latest

func (p *MySql) Latest() string

func (*MySql) Up

func (p *MySql) Up() string

func (*MySql) Version

func (p *MySql) Version() string

type Oracle

type Oracle struct {
}

func (*Oracle) All

func (p *Oracle) All() string

func (*Oracle) ByVersion

func (p *Oracle) ByVersion() string

func (*Oracle) CreateSchemaMigrationsTable

func (p *Oracle) CreateSchemaMigrationsTable() string

func (*Oracle) Down

func (p *Oracle) Down() string

func (*Oracle) DropSchemaMigrationsTable

func (p *Oracle) DropSchemaMigrationsTable() string

func (*Oracle) HibernateSequence

func (p *Oracle) HibernateSequence() (string, string)

func (*Oracle) Insert

func (p *Oracle) Insert() string

func (*Oracle) Latest

func (p *Oracle) Latest() string

func (*Oracle) Up

func (p *Oracle) Up() string

func (*Oracle) Version

func (p *Oracle) Version() string

type PostgreSql

type PostgreSql struct {
}

func (*PostgreSql) All

func (p *PostgreSql) All() string

func (*PostgreSql) ByVersion

func (p *PostgreSql) ByVersion() string

func (*PostgreSql) CreateSchemaMigrationsTable

func (p *PostgreSql) CreateSchemaMigrationsTable() string

func (*PostgreSql) Down

func (p *PostgreSql) Down() string

func (*PostgreSql) DropSchemaMigrationsTable

func (p *PostgreSql) DropSchemaMigrationsTable() string

func (*PostgreSql) HibernateSequence

func (p *PostgreSql) HibernateSequence() (string, string)

func (*PostgreSql) Insert

func (p *PostgreSql) Insert() string

func (*PostgreSql) Latest

func (p *PostgreSql) Latest() string

func (*PostgreSql) Up

func (p *PostgreSql) Up() string

func (*PostgreSql) Version

func (p *PostgreSql) Version() string

type SqlServer

type SqlServer struct {
}

func (*SqlServer) All

func (p *SqlServer) All() string

func (*SqlServer) ByVersion

func (p *SqlServer) ByVersion() string

func (*SqlServer) CreateSchemaMigrationsTable

func (p *SqlServer) CreateSchemaMigrationsTable() string

func (*SqlServer) Down

func (p *SqlServer) Down() string

func (*SqlServer) DropSchemaMigrationsTable

func (p *SqlServer) DropSchemaMigrationsTable() string

func (*SqlServer) HibernateSequence

func (p *SqlServer) HibernateSequence() (string, string)

func (*SqlServer) Insert

func (p *SqlServer) Insert() string

func (*SqlServer) Latest

func (p *SqlServer) Latest() string

func (*SqlServer) Up

func (p *SqlServer) Up() string

func (*SqlServer) Version

func (p *SqlServer) Version() string

type Sqlite3

type Sqlite3 struct {
}

func (*Sqlite3) All

func (p *Sqlite3) All() string

func (*Sqlite3) ByVersion

func (p *Sqlite3) ByVersion() string

func (*Sqlite3) CreateSchemaMigrationsTable

func (p *Sqlite3) CreateSchemaMigrationsTable() string

func (*Sqlite3) Down

func (p *Sqlite3) Down() string

func (*Sqlite3) DropSchemaMigrationsTable

func (p *Sqlite3) DropSchemaMigrationsTable() string

func (*Sqlite3) HibernateSequence

func (p *Sqlite3) HibernateSequence() (string, string)

func (*Sqlite3) Insert

func (p *Sqlite3) Insert() string

func (*Sqlite3) Latest

func (p *Sqlite3) Latest() string

func (*Sqlite3) Open

func (p *Sqlite3) Open(dsn string) (*sql.DB, error)

func (*Sqlite3) Up

func (p *Sqlite3) Up() string

func (*Sqlite3) Version

func (p *Sqlite3) Version() string

Jump to

Keyboard shortcuts

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