Documentation ¶
Index ¶
- func CreateMigrationTable(db *sqlx.DB, query string) (string, error)
- func HasMigrationTable(db *sqlx.DB, query string) (bool, error)
- func InsertRecord(tx *sqlx.Tx, query string, args ...interface{}) error
- func QueryPrevious(db *sqlx.DB, query string) (map[string]string, error)
- func RepairHashes(tx *sqlx.Tx, query string, hashes map[string]string) error
- type Backend
- type MigrationRecord
- type MySQL
- func (m *MySQL) CreateMigrationTable() (string, error)
- func (m *MySQL) HasMigrationTable() (bool, error)
- func (m *MySQL) InsertRecord(tx *sqlx.Tx, name string, hash string, comment string) error
- func (m *MySQL) QueryPrevious() (map[string]string, error)
- func (m *MySQL) RepairHashes(tx *sqlx.Tx, hashes map[string]string) error
- func (m *MySQL) Setup(db *sqlx.DB, table string, tableSchema string)
- type Postgres
- func (p *Postgres) CreateMigrationTable() (string, error)
- func (p *Postgres) HasMigrationTable() (bool, error)
- func (p *Postgres) InsertRecord(tx *sqlx.Tx, name string, hash string, comment string) error
- func (p *Postgres) QueryPrevious() (map[string]string, error)
- func (p *Postgres) RepairHashes(tx *sqlx.Tx, hashes map[string]string) error
- func (p *Postgres) Setup(db *sqlx.DB, table string, tableSchema string)
- type SQLite
- func (s *SQLite) CreateMigrationTable() (string, error)
- func (s *SQLite) HasMigrationTable() (bool, error)
- func (s *SQLite) InsertRecord(tx *sqlx.Tx, name string, hash string, comment string) error
- func (s *SQLite) QueryPrevious() (map[string]string, error)
- func (s *SQLite) RepairHashes(tx *sqlx.Tx, hashes map[string]string) error
- func (s *SQLite) Setup(db *sqlx.DB, table string, tableSchema string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryPrevious ¶
QueryPrevious runs the query from the Backend.QueryPrevious and returns the results.
Types ¶
type Backend ¶
type Backend interface { // Setup does the initial configuration of the backend. Setup(db *sqlx.DB, table string, tableSchema string) // InsertRecord migration record into the DB. InsertRecord(tx *sqlx.Tx, name string, hash string, comment string) error // HasMigrationTable returns true if the migration table exists. HasMigrationTable() (bool, error) // QueryPrevious queries and sets the records of all previous migrations. QueryPrevious() (map[string]string, error) // CreateMigrationTable makes the migrations table, and return the query used to // do it. CreateMigrationTable() (string, error) RepairHashes(tx *sqlx.Tx, hashes map[string]string) error }
type MigrationRecord ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) CreateMigrationTable ¶
CreateMigrationTable makes the migrations table, and return the query used to do it.
func (*MySQL) HasMigrationTable ¶
HasMigrationTable returns true if the migration table exists.
func (*MySQL) InsertRecord ¶
InsertRecord migration record into the DB.
func (*MySQL) QueryPrevious ¶
QueryPrevious queries and sets the records of all previous migrations.
func (*MySQL) RepairHashes ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) CreateMigrationTable ¶
CreateMigrationTable makes the migrations table, and return the query used to do it.
func (*Postgres) HasMigrationTable ¶
HasMigrationTable returns true if the migration table exists.
func (*Postgres) InsertRecord ¶
InsertRecord migration record into the DB.
func (*Postgres) QueryPrevious ¶
QueryPrevious queries and sets the records of all previous migrations.
func (*Postgres) RepairHashes ¶
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
func (*SQLite) CreateMigrationTable ¶
CreateMigrationTable makes the migrations table, and return the query used to do it.
func (*SQLite) HasMigrationTable ¶
HasMigrationTable returns true if the migration table exists.
func (*SQLite) InsertRecord ¶
InsertRecord migration record into the DB.
func (*SQLite) QueryPrevious ¶
QueryPrevious queries and sets the records of all previous migrations.