postgres

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(dsn string) (*sql.DB, error)

Types

type Postgres

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

func NewPostgres

func NewPostgres(ctx context.Context, dsn string) (*Postgres, error)

func (*Postgres) Begin

func (pg *Postgres) Begin(ctx context.Context) (pgx.Tx, error)

func (*Postgres) BeginReadOnly

func (pg *Postgres) BeginReadOnly(ctx context.Context) (pgx.Tx, error)

func (*Postgres) Close

func (pg *Postgres) Close()

func (*Postgres) CreateDatabase

func (pg *Postgres) CreateDatabase(ctx context.Context, dbname string) error

func (*Postgres) CreateDatabaseIfNotExists

func (pg *Postgres) CreateDatabaseIfNotExists(ctx context.Context, dbname string) error

func (*Postgres) CreateOrReplaceDatabase

func (pg *Postgres) CreateOrReplaceDatabase(ctx context.Context, dbname string) error

func (*Postgres) DropDatabase

func (pg *Postgres) DropDatabase(ctx context.Context, dbname string) error

func (*Postgres) DropDatabaseIfExists

func (pg *Postgres) DropDatabaseIfExists(ctx context.Context, dbname string) error

func (*Postgres) Ping

func (pg *Postgres) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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