support

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRows

func ParseRows(rows *sqlx.Rows) (results []contracts.Fields, err error)

func ParseRowsToCollection

func ParseRowsToCollection(rows *sqlx.Rows) (contracts.Collection[contracts.Fields], error)

func SetColVarType added in v0.1.10

func SetColVarType(colVar *[]any, i int, typeName string)

func SetResultValue added in v0.1.10

func SetResultValue(result *map[string]any, index string, colVar any, typeName string)

Types

type BaseExecutor

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

func (*BaseExecutor) DriverName

func (base *BaseExecutor) DriverName() string

func (*BaseExecutor) Exec

func (base *BaseExecutor) Exec(query string, args ...any) (result contracts.Result, exception contracts.Exception)

func (*BaseExecutor) Get

func (base *BaseExecutor) Get(dest any, query string, args ...any) (err contracts.Exception)

func (*BaseExecutor) Query

func (base *BaseExecutor) Query(query string, args ...any) (results contracts.Collection[contracts.Fields], exception contracts.Exception)

func (*BaseExecutor) Select

func (base *BaseExecutor) Select(dest any, query string, args ...any) (err contracts.Exception)

type Executor

type Executor interface {
	DriverName() string
	Query(query string, args ...any) (contracts.Collection[contracts.Fields], contracts.Exception)
	Get(dest any, query string, args ...any) (err contracts.Exception)
	Select(dest any, query string, args ...any) (err contracts.Exception)
	Exec(query string, args ...any) (contracts.Result, contracts.Exception)
}

func NewExecutor

func NewExecutor(executor SqlxExecutor, dispatcher contracts.EventDispatcher, wrapper func(sql string) string) Executor

type SqlxExecutor

type SqlxExecutor interface {
	DriverName() string
	Queryx(query string, args ...any) (*sqlx.Rows, error)
	Get(dest any, query string, args ...any) (err error)
	Select(dest any, query string, args ...any) (err error)
	Exec(query string, args ...any) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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