psqldb

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnteConvergenceScripts = []string{
	filepath.Join("db", "ante-schema.sql"),
}

AnteConvergenceScripts is the DDL script files applied before the schema is converged.

View Source
var LoadEnv = func() {}
View Source
var PostConvergenceScripts = []string{
	filepath.Join("db", "post-schema.sql"),
}

PostConvergenceScripts is the DDL script files applied after the schema is converged.

Functions

func Psql

func Psql() (err error)

Psql executes psql(1) command on the database defined in .env* file

Types

type Db

type Db mg.Namespace

func (Db) Converge

func (Db) Converge() (err error)

Converge converges a PostgreSQL database.

func (Db) Create

func (Db) Create() error

Create creates a new PostgreSQL database.

func (Db) Down

func (Db) Down() error

Down rolls back the database version by 1.

func (Db) Drop

func (Db) Drop() error

Drop drops a PostgreSQL database if exists.

func (Db) Dump

func (Db) Dump() error

Dump dumps a database.

func (Db) Fix

func (Db) Fix() error

Fix applies sequential ordering to migrations.

func (Db) Gen

func (Db) Gen() (err error)

Gen generates bindings and helpers for a database.

func (Db) Migrate

func (db Db) Migrate() (err error)

Migrate migrates the database to the most recent version available.

func (Db) New

func (Db) New(name string) error

New (name string) creates a new migration file with the current timestamp.

func (Db) Reset

func (Db) Reset() error

Reset rolls back all migrations.

func (Db) Seed

func (Db) Seed() error

Seed inserts seed data into the database.

func (Db) Up

func (Db) Up() error

Up migrates the database up by 1.

Jump to

Keyboard shortcuts

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