Sql

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBMap

func DBMap(columns []string, rows *sql.Rows) ([]interface{}, error)

func QueryForMaps

func QueryForMaps(sql string, mapping map[string]string, args ...interface{}) ([]interface{}, error)

func QueryForMapsByInterface

func QueryForMapsByInterface(query Query) (interface{}, error)

Types

type GPA

type GPA interface {
	DB() *sql.DB
}

type GPAUtil

type GPAUtil struct {
	GDB GPA `inject:"-"`
}

func NewGPAUtil

func NewGPAUtil() *GPAUtil

type Query

type Query interface {
	Sql() string
	Args() []interface{}
	Mapping() map[string]string
	First() bool
	Key() string
	Get() interface{}
}

sql返回值解析

type SimpleQuery

type SimpleQuery string

func (SimpleQuery) Args

func (this SimpleQuery) Args() []interface{}

func (SimpleQuery) First

func (this SimpleQuery) First() bool

func (SimpleQuery) Get

func (this SimpleQuery) Get() interface{}

func (SimpleQuery) Key

func (this SimpleQuery) Key() string

func (SimpleQuery) Mapping

func (this SimpleQuery) Mapping() map[string]string

func (SimpleQuery) Sql

func (this SimpleQuery) Sql() string

func (SimpleQuery) WithArgs

func (this SimpleQuery) WithArgs(args ...interface{}) *SimpleQueryWithArgs

func (SimpleQuery) WithFirst

func (this SimpleQuery) WithFirst() *SimpleQueryWithArgs

func (SimpleQuery) WithKey

func (this SimpleQuery) WithKey(key string) *SimpleQueryWithArgs

func (SimpleQuery) WithMapping

func (this SimpleQuery) WithMapping(mapping map[string]string) *SimpleQueryWithArgs

type SimpleQueryWithArgs

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

func NewSimpleQueryWithArgs

func NewSimpleQueryWithArgs(sql string, args []interface{}) *SimpleQueryWithArgs

func NewSimpleQueryWithFetchFirst

func NewSimpleQueryWithFetchFirst(sql string) *SimpleQueryWithArgs

func NewSimpleQueryWithKey

func NewSimpleQueryWithKey(sql string, key string) *SimpleQueryWithArgs

func NewSimpleQueryWithMapping

func NewSimpleQueryWithMapping(sql string, mapping map[string]string) *SimpleQueryWithArgs

func (*SimpleQueryWithArgs) Args

func (this *SimpleQueryWithArgs) Args() []interface{}

func (*SimpleQueryWithArgs) First

func (this *SimpleQueryWithArgs) First() bool

func (*SimpleQueryWithArgs) Get

func (this *SimpleQueryWithArgs) Get() interface{}

func (*SimpleQueryWithArgs) Key

func (this *SimpleQueryWithArgs) Key() string

func (*SimpleQueryWithArgs) Mapping

func (this *SimpleQueryWithArgs) Mapping() map[string]string

func (*SimpleQueryWithArgs) Sql

func (this *SimpleQueryWithArgs) Sql() string

func (*SimpleQueryWithArgs) WithFirst

func (this *SimpleQueryWithArgs) WithFirst() *SimpleQueryWithArgs

func (*SimpleQueryWithArgs) WithKey

func (this *SimpleQueryWithArgs) WithKey(key string) *SimpleQueryWithArgs

func (*SimpleQueryWithArgs) WithMapping

func (this *SimpleQueryWithArgs) WithMapping(mapping map[string]string) *SimpleQueryWithArgs

Jump to

Keyboard shortcuts

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