repository

package
v0.0.0-...-9fb9eb8 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrZeroRowsAffected = errors.New("no rows affected")
)

Functions

func NewTxRunner

func NewTxRunner(db *sqlx.DB) *txRunner

Types

type BaseContextRepository

type BaseContextRepository struct {
	// contains filtered or unexported fields
}

func NewBaseContextRepository

func NewBaseContextRepository(db *sqlx.DB, appName string, tableName string) BaseContextRepository

func (*BaseContextRepository) BindNamed

func (r *BaseContextRepository) BindNamed(query string, arg interface{}) (string, []interface{}, error)

func (*BaseContextRepository) DBExec

func (r *BaseContextRepository) DBExec(ctx context.Context, query string, args ...interface{}) error

func (*BaseContextRepository) DBExecInTx

func (r *BaseContextRepository) DBExecInTx(ctx context.Context, tx *sqlx.Tx, query string, args ...interface{}) error

func (*BaseContextRepository) DBExecReturning

func (r *BaseContextRepository) DBExecReturning(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBExecReturningInTx

func (r *BaseContextRepository) DBExecReturningInTx(ctx context.Context, tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBGet

func (r *BaseContextRepository) DBGet(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBGetInTx

func (r *BaseContextRepository) DBGetInTx(ctx context.Context, tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBNamedExec

func (r *BaseContextRepository) DBNamedExec(ctx context.Context, query string, arg interface{}) error

func (*BaseContextRepository) DBNamedExecInTx

func (r *BaseContextRepository) DBNamedExecInTx(ctx context.Context, tx *sqlx.Tx, query string, arg interface{}) error

func (*BaseContextRepository) DBNamedExecReturning

func (r *BaseContextRepository) DBNamedExecReturning(ctx context.Context, dest interface{}, query string, arg interface{}) error

func (*BaseContextRepository) DBNamedExecReturningInTx

func (r *BaseContextRepository) DBNamedExecReturningInTx(ctx context.Context, tx *sqlx.Tx, dest interface{}, query string, arg interface{}) error

func (*BaseContextRepository) DBSelect

func (r *BaseContextRepository) DBSelect(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBSelectInTx

func (r *BaseContextRepository) DBSelectInTx(ctx context.Context, tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseContextRepository) DBSoftExec

func (r *BaseContextRepository) DBSoftExec(ctx context.Context, query string, args ...interface{}) error

func (*BaseContextRepository) DBSoftExecInTx

func (r *BaseContextRepository) DBSoftExecInTx(ctx context.Context, tx *sqlx.Tx, query string, args ...interface{}) error

type BaseRepository

type BaseRepository struct {
	// contains filtered or unexported fields
}

func NewBaseRepository

func NewBaseRepository(db *sqlx.DB, appName string, tableName string) BaseRepository

func (*BaseRepository) DBExec

func (r *BaseRepository) DBExec(query string, args ...interface{}) error

func (*BaseRepository) DBExecInTx

func (r *BaseRepository) DBExecInTx(tx *sqlx.Tx, query string, args ...interface{}) error

func (*BaseRepository) DBExecReturning

func (r *BaseRepository) DBExecReturning(dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBExecReturningInTx

func (r *BaseRepository) DBExecReturningInTx(tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBGet

func (r *BaseRepository) DBGet(dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBGetInTx

func (r *BaseRepository) DBGetInTx(tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBSelect

func (r *BaseRepository) DBSelect(dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBSelectInTx

func (r *BaseRepository) DBSelectInTx(tx *sqlx.Tx, dest interface{}, query string, args ...interface{}) error

func (*BaseRepository) DBSoftExec

func (r *BaseRepository) DBSoftExec(query string, args ...interface{}) error

func (*BaseRepository) DBSoftExecInTx

func (r *BaseRepository) DBSoftExecInTx(tx *sqlx.Tx, query string, args ...interface{}) error

type TxRunner

type TxRunner interface {
	RunInTx(fn func(*sqlx.Tx) error) error
	RunInTxContext(ctx context.Context, fn func(*sqlx.Tx) error) error
}

Jump to

Keyboard shortcuts

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