typpostgres

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Console

func Console(ctx *typictx.ActionContext) (err error)

Console to run psql with username/password as in configuration

func CreateDB

func CreateDB(ctx *typictx.ActionContext) (err error)

CreateDB is tool to create new database

func DropDB

func DropDB(ctx *typictx.ActionContext) (err error)

DropDB is tool to drop database

func MigrateDB

func MigrateDB(ctx *typictx.ActionContext) (err error)

MigrateDB is tool to migrate database

func Module

func Module() *typictx.Module

Module for postgres

func RollbackDB

func RollbackDB(ctx *typictx.ActionContext) (err error)

RollbackDB is tool to rollback database

Types

type Config

type Config struct {
	DbName       string `required:"true"`
	User         string `required:"true" default:"postgres"`
	Password     string `required:"true" default:"pgpass"`
	Host         string `default:"localhost"`
	Port         int    `default:"5432"`
	MigrationSrc string `default:"scripts/migration"`
}

Config is postgres configuration

func (*Config) AdminDataSource

func (c *Config) AdminDataSource() string

AdminDataSource return connection string for adminitration script

func (*Config) DataSource

func (c *Config) DataSource() string

DataSource return connection string

func (*Config) DatabaseName

func (c *Config) DatabaseName() string

DatabaseName return the database name

func (*Config) DriverName

func (c *Config) DriverName() string

DriverName return the driver name

func (*Config) MigrationSource

func (c *Config) MigrationSource() string

MigrationSource return the migration source

Jump to

Keyboard shortcuts

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