internal

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetError added in v0.1.7

func GetError(err error, query string, args ...interface{}) error

func ResolveFirstDataResult added in v0.5.0

func ResolveFirstDataResult(rows *sql.Rows, result any) (err error)

解析数据结果

func ResolveFirstRow added in v0.5.0

func ResolveFirstRow(rows *sql.Rows) (dataRows xdb.Row, err error)

func ResolveMultiRows added in v0.1.7

func ResolveMultiRows(rows *sql.Rows) (datasetRows []xdb.Rows, err error)

func ResolveParams added in v0.5.0

func ResolveParams(input any) (params xtypes.XMap, err error)

func ResolveRows added in v0.1.7

func ResolveRows(rows *sql.Rows) (dataRows xdb.Rows, err error)

func ResolveRowsDataResult added in v0.5.0

func ResolveRowsDataResult(rows *sql.Rows, result any) (err error)

解析数据结果

func ResolveScalar added in v0.5.0

func ResolveScalar(rows *sql.Rows) (val any, err error)

func Unwrap added in v0.1.30

func Unwrap(args ...interface{}) []interface{}

Types

type DbResolveMapValCallback added in v0.5.0

type DbResolveMapValCallback func(*sql.Rows) (result any, err error)

type DbResolveResultCallback added in v0.5.0

type DbResolveResultCallback func(*sql.Rows, any) error

type ISysDB

type ISysDB interface {
	Query(string, ...interface{}) (*sql.Rows, error)
	Exec(string, ...interface{}) (sql.Result, error)
	Begin() (ISysTrans, error)
	Close() error
}

func NewSysDB

func NewSysDB(proto string, conn string, maxOpen int, maxIdle int, maxLifeTime time.Duration) (ISysDB, error)

NewSysDB 创建DB实例

type ISysTrans

type ISysTrans interface {
	Query(string, ...interface{}) (*sql.Rows, error)
	Execute(string, ...interface{}) (sql.Result, error)
	Rollback() error
	Commit() error
}

ISysTrans 数据库事务接口

type WrapArgs added in v0.2.0

type WrapArgs struct {
	Name  string
	Value any
	Out   bool
}

func (WrapArgs) MarshalJSON added in v0.2.2

func (a WrapArgs) MarshalJSON() (result []byte, err error)

func (WrapArgs) String added in v0.2.0

func (a WrapArgs) String() string

Jump to

Keyboard shortcuts

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