postgres

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2018 License: Apache-2.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDown

func MigrateDown(db *sql.DB, steps int, logger kitlog.Logger) error

MigrateDown attempts to run down migrations against Postgres. It takes as parameters an sql.DB instance, the number of steps to run, and a logger instance. Migrations are loaded from a bindata generated module that is compiled into the binary.

func MigrateDownAll

func MigrateDownAll(db *sql.DB, logger kitlog.Logger) error

MigrateDownAll attempts to run all down migrations against Postgres. It takes as parameters an sql.DB instance, and a logger instance. Migrations are loaded from a bindata generated module that is compiled into the binary.

func MigrateUp

func MigrateUp(db *sql.DB, logger kitlog.Logger) error

MigrateUp attempts to run all up migrations against Postgres. Migrations are loaded from a bindata generated module that is compiled into the binary. It takes as parameters an sql.DB instance, and a logger instance.

func NewMigration

func NewMigration(dirName, migrationName string, logger kitlog.Logger) error

NewMigration creates a new pair of files into which an SQL migration should be written. All this is doing is ensuring files created are correctly named.

func Open

func Open(connStr string) (*sqlx.DB, error)

Open takes as input a connection string for a DB, and returns either a sqlx.DB instance or an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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