Documentation ¶
Overview ¶
Package database provides support for accessing the database.
Index ¶
- Variables
- func NamedExec(log *zerolog.Logger, db sqlx.Ext, query string, data any) (err error)
- func NamedQuerySlice[T any](log *zerolog.Logger, db sqlx.Ext, query string, data any, dest *[]T) (err error)
- func NamedQueryStruct(log *zerolog.Logger, db sqlx.Ext, query string, data any, dest any) (err error)
- func Open(cfg Config) (*sqlx.DB, error)
- func Ping(ctx context.Context, db *sqlx.DB) error
- func WithinTran(log *zerolog.Logger, db *sqlx.DB, fn func(*sqlx.Tx) error) error
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = sql.ErrNoRows ErrUniqueViolation = errors.New("duplicated entry") ErrUndefinedTable = errors.New("undefined table") )
Set of error variables for CRUD operations.
Functions ¶
func NamedQuerySlice ¶
func NamedQueryStruct ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.