database

package
v0.0.0-...-b3c1e48 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PostgresDriverName = "pgx"

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlDatabase

type SqlDatabase struct {
	DB *sql.DB
}

func NewSqlDatabase

func NewSqlDatabase(ctx context.Context, driverName string, dataSourceName string) (*SqlDatabase, error)

NewSqlDatabase returns a pointer to new SqlDatabase instance. This function checks if supported driver name is provided, and pings the database to validate given data source name.

func (*SqlDatabase) Setup

func (sd *SqlDatabase) Setup(ctx context.Context) error

Setup sets up database migrations.

func (*SqlDatabase) Teardown

func (sd *SqlDatabase) Teardown(ctx context.Context) error

Teardown drops database migrations.

Jump to

Keyboard shortcuts

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