database

package
v0.0.0-...-fa6ae4b Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database represents a new database.

func New

func New(ctx context.Context, dsn string) Database

New returns a new database.

func (Database) InTx

func (db Database) InTx(ctx context.Context, fn ...func(tx pgx.Tx) error) error

InTx runs the given function f within a transaction with isolation level serialization by default.

func (Database) IsSchemaUpToDate

func (db Database) IsSchemaUpToDate(ctx context.Context) error

IsSchemaUpToDate checks if the database schema is up to date.

func (Database) Migrate

func (db Database) Migrate(ctx context.Context) error

Migrate executes database migrations.

Jump to

Keyboard shortcuts

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