session

package
v0.0.0-kmdagger1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session interface {
	Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
	Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)
}

type SessionDB

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

func GetSession

func GetSession(sqlxdb *sqlx.DB) *SessionDB

func (*SessionDB) Beginx

func (gs *SessionDB) Beginx() (*SessionTx, error)

func (*SessionDB) Exec

func (gs *SessionDB) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*SessionDB) ExecWithReturningId

func (gs *SessionDB) ExecWithReturningId(ctx context.Context, query string, args ...interface{}) (int64, error)

func (*SessionDB) Get

func (gs *SessionDB) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*SessionDB) NamedExec

func (gs *SessionDB) NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)

func (*SessionDB) Query

func (gs *SessionDB) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*SessionDB) Select

func (gs *SessionDB) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*SessionDB) WithTransaction

func (gs *SessionDB) WithTransaction(ctx context.Context, callback func(*SessionTx) error) error

type SessionTx

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

func (*SessionTx) Exec

func (gtx *SessionTx) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*SessionTx) ExecWithReturningId

func (gtx *SessionTx) ExecWithReturningId(ctx context.Context, query string, args ...interface{}) (int64, error)

func (*SessionTx) Get

func (gtx *SessionTx) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*SessionTx) NamedExec

func (gtx *SessionTx) NamedExec(ctx context.Context, query string, arg interface{}) (sql.Result, error)

func (*SessionTx) Query

func (gtx *SessionTx) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

Jump to

Keyboard shortcuts

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