postgresql

package
v0.0.0-...-e6936e5 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrint

func PrettyPrint(prefix string, i interface{})

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(
	host string,
	port int,
	user string,
	ssl bool,
	password,
	database,
	migrationTableName string,
) (Driver, error)

func NewDriverWithConfig

func NewDriverWithConfig(config DriverConfig) (Driver, error)

func (Driver) Apply

func (p Driver) Apply(command string) error

func (Driver) Close

func (p Driver) Close() error

func (Driver) Connect

func (p Driver) Connect() error

func (Driver) GetAppliedMigrations

func (p Driver) GetAppliedMigrations() ([]string, error)

func (Driver) GetClient

func (p Driver) GetClient() *sql.DB

func (Driver) GetVersion

func (p Driver) GetVersion() (int, error)

func (Driver) InitSchema

func (p Driver) InitSchema() error

func (Driver) PopVersion

func (p Driver) PopVersion() error

func (Driver) PushVersion

func (p Driver) PushVersion(version int) error

type DriverConfig

type DriverConfig struct {
	Host               string
	Port               int
	Username           string
	SSL                bool
	Password           string
	DatabaseName       string
	MigrationTableName string
}

func NewConfig

func NewConfig(
	host string,
	port int,
	user string,
	ssl bool,
	password,
	database,
	migrationTableName string,
) DriverConfig

func (DriverConfig) GetDSN

func (p DriverConfig) GetDSN() string

func (DriverConfig) GetDriverName

func (p DriverConfig) GetDriverName() string

Jump to

Keyboard shortcuts

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