postgres

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCodeEqual added in v0.11.3

func ErrorCodeEqual(err error, code ErrPgCode) bool

func Migrate

func Migrate(connURL string) error

Migrate to run up migrations

func NewMigrator

func NewMigrator(dbConnURL string) (*migrate.Migrate, error)

func Open

func Open(config config.DBConfig) (*pgxpool.Pool, error)

Open will connect to the DB with custom configuration

func Rollback

func Rollback(connURL string, count int) error

Rollback to run up migrations

func ToVersion

func ToVersion(version uint, connURL string) error

Types

type ErrPgCode added in v0.11.3

type ErrPgCode string

ErrPgCode refers to https://www.postgresql.org/docs/current/errcodes-appendix.html

const (
	ErrPgCodeUniqueConstraints ErrPgCode = "23505"
)

func (ErrPgCode) Equal added in v0.11.3

func (e ErrPgCode) Equal(code string) bool

func (ErrPgCode) String added in v0.11.3

func (e ErrPgCode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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