postgres

package
v0.0.0-...-1af4f67 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {

	// Embed the sqlx DB struct
	*sqlx.DB
	// contains filtered or unexported fields
}

func New

func New(
	user, pass, host, dbName string,
	port int,
	sslKey, sslCert, sslCA string,
) *DB

func (*DB) CreateMetaCheckpointsIfNotExists

func (db *DB) CreateMetaCheckpointsIfNotExists() error

func (*DB) CreateMetaIfNotExists

func (db *DB) CreateMetaIfNotExists() error

func (*DB) CreateMetaVersionIfNotExists

func (db *DB) CreateMetaVersionIfNotExists() (int, error)

func (*DB) DeleteMetaCheckpoints

func (db *DB) DeleteMetaCheckpoints() error

func (*DB) GetMetaCheckpoints

func (db *DB) GetMetaCheckpoints(filename string) ([]string, error)

func (*DB) GetMigrations

func (db *DB) GetMigrations() ([]migrate.Migration, error)

func (*DB) InsertMetaCheckpoint

func (db *DB) InsertMetaCheckpoint(
	filename, content, checksum string,
	idx int,
) error

func (*DB) InsertMigration

func (db *DB) InsertMigration(filename, content, checksum string) error

func (*DB) Open

func (db *DB) Open() error

func (*DB) UpgradeToV1

func (db *DB) UpgradeToV1(migrations []migrate.Migration) (err error)

UpgradeToV1 migrates existing meta tables to the v1 format. Complete any migrations before running this function; this will not succeed if have any existing metacheckpoints.

func (*DB) UpsertMigration

func (db *DB) UpsertMigration(filename, content, checksum string) error

Jump to

Keyboard shortcuts

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