database

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForDB

func WaitForDB(ctx context.Context, pgdsn string) error

WaitForDB waits for the database to be ready

Types

type Postgres

type Postgres struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

Postgres is the database connection

func NewPostgres

func NewPostgres(pgdsn string) (*Postgres, error)

NewPostgres creates a new Postgres database connection

func (*Postgres) Close

func (p *Postgres) Close() error

Close closes the database connection

func (*Postgres) GetDB

func (p *Postgres) GetDB() *sql.DB

GetDB returns the database connection

func (*Postgres) InitDB

func (p *Postgres) InitDB() error

InitDB initializes the database

Jump to

Keyboard shortcuts

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