rdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transact

func Transact(ctx context.Context, db *sql.DB, f func(context.Context, *sql.Tx) error) (err error)

Types

type AlbumRepository

type AlbumRepository interface {
	Create(ctx context.Context, exe Executor, src model.AlbumSource) (*model.Album, error)
	Get(ctx context.Context, exe Executor, ean string) (*model.Album, error)
	GetForUpdate(ctx context.Context, exe Executor, ean string) (*model.Album, error)
	ListAll(ctx context.Context, exe Executor) ([]*model.Album, error)
	Update(ctx context.Context, exe Executor, ean string, params QueryParams) (*model.Album, error)
	Delete(ctx context.Context, exe Executor, ean string) error
}

type Executor

type Executor interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

type QueryParams

type QueryParams map[string]any

func (QueryParams) QueryPartsAndArgs

func (params QueryParams) QueryPartsAndArgs() ([]string, []any)

type Scanner

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

Jump to

Keyboard shortcuts

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