db

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrationsDown

func RunMigrationsDown(db *sql.DB) error

RunMigrationsDown runs migrate-down for the given config.

func RunMigrationsUp

func RunMigrationsUp(db *sql.DB) error

RunMigrationsUp runs migrate-up for the given config.

Types

type DB

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

DB is the database layer of the data node

func New

func New(pg *pgxpool.Pool) *DB

New instantiates a DB

func (*DB) BeginStateTransaction

func (db *DB) BeginStateTransaction(ctx context.Context) (pgx.Tx, error)

BeginStateTransaction begins a DB transaction. The caller is responsible for committing or rolling back the transaction

Jump to

Keyboard shortcuts

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