postgres

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows = pgx.ErrNoRows

	ErrTxClosed         = pgx.ErrTxClosed
	ErrTxCommitRollback = pgx.ErrTxCommitRollback
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`

	Database string `yaml:"database"`
	Address  string `yaml:"address"`
}

func (*Config) Repair

func (c *Config) Repair()

func (*Config) String

func (c *Config) String() string

type Conn

type Conn struct {
	*pgxpool.Pool
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context, conf Config) (*Conn, error)

func (*Conn) Close

func (conn *Conn) Close()

func (*Conn) Migrate

func (conn *Conn) Migrate(ctx context.Context, migrations *embed.FS) error

func (*Conn) MigrateTo

func (conn *Conn) MigrateTo(ctx context.Context, migrations *embed.FS, targetNumber int) error

func (*Conn) Tx

func (conn *Conn) Tx(ctx context.Context, f func(tx Tx) error) error

type Tx

type Tx = pgx.Tx

Jump to

Keyboard shortcuts

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