database

package
v0.0.0-...-4164891 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NullStringColumn

func NullStringColumn(s string) *string

NullStringColumn represents a string that should be inserted/updated as NULL when blank.

Types

type DB

type DB interface {
	Close() error
	Ping(context.Context) error
	Exec(context.Context, *sqlf.Query) error
	QueryRow(context.Context, *sqlf.Query) *sql.Row
	Query(context.Context, *sqlf.Query) (*sql.Rows, error)

	WithTransact(ctx context.Context, f func(Tx) error) error
}

func NewDB

func NewDB(url string, bindvar sqlf.BindVar) (DB, error)

NewDB returns a new instance of the database

type Scanner

type Scanner interface {
	Scan(dest ...any) error
}

type Tx

type Tx interface {
	DB

	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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