db

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTransaction

func WithTransaction(db *sqlx.DB, fn func(tx *sqlx.Tx) error) error

Types

type DBHandler

type DBHandler interface {
	DB() *sqlx.DB
	Host() string
	Name() string
	Port() string

	Ping() error
	Close()

	GetById(ctx context.Context, result interface{}, query string, id interface{}) error
	Get(ctx context.Context, results interface{}, query string, params ...interface{}) error
	Select(ctx context.Context, results interface{}, query string, params ...interface{}) error
	InsertWithId(ctx context.Context, query string, params ...interface{}) (int64, error)
	Insert(ctx context.Context, query string, params ...interface{}) error
	Update(ctx context.Context, query string, params ...interface{}) (int64, error)
	Delete(ctx context.Context, query string, params ...interface{}) (int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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