internal

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 10 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 ResolveMultiRows added in v0.1.7

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

func ResolveRows added in v0.1.7

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

func Unwrap added in v0.1.30

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

Types

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