Versions in this module Expand all Collapse all v0 v0.1.0 Feb 18, 2016 Changes in this version + var ErrInvalidValue = errors.New("Invalid values!") + func AssignList(entity QueryEntity, output interface{}) error + func AssignSingle(entity QueryEntity, output interface{}) error + func List(entity QueryEntity) ([]map[string]string, error) + func NewQueryEntity(table string, cond QueryCondition, fields ...string) func(resultType ...QueryResultType) QueryEntityResult + func Query(entity QueryEntity) (interface{}, error) + func RegisterDBProvider(provideName ProvideEngine, provider DBProvider) + func RegisterProvider(provideName ProvideEngine, config string) error + func Single(entity QueryEntity) (map[string]string, error) + type CondType byte + const COND_CV + const COND_KV + type DBProvider interface + InitDB func(config string) error + type PagerParam struct + PageIndex int + PageSize int + func NewPagerParam(pageIndex, pageSize int) PagerParam + type ProvideEngine string + const MYSQL + type Provider interface + var GDAL Provider + type QueryCondition struct + CType CondType + Condition string + FieldsKv map[string]interface{} + Values []interface{} + type QueryConditionResult struct + Condition QueryCondition + func NewCondition(condition string, values ...interface{}) QueryConditionResult + func NewFieldsKvCondition(fieldsKv interface{}) QueryConditionResult + type QueryEntity struct + Condition QueryCondition + FieldsSelect string + PagerParam PagerParam + ResultType QueryResultType + Table string + type QueryEntityResult struct + Entity QueryEntity + func NewQueryPagerEntity(table string, cond QueryCondition, pagerParam PagerParam, fields ...string) QueryEntityResult + type QueryPagerResult struct + Rows []map[string]interface{} + Total int64 + func Pager(entity QueryEntity) (QueryPagerResult, error) + type QueryProvider interface + AssignList func(QueryEntity, interface{}) error + AssignSingle func(QueryEntity, interface{}) error + List func(QueryEntity) ([]map[string]string, error) + Pager func(QueryEntity) (QueryPagerResult, error) + Query func(QueryEntity) (interface{}, error) + Single func(QueryEntity) (map[string]string, error) + type QueryResultType byte + const QList + const QPager + const QSingle + type ResultError struct + Error error + type TranEntity struct + Condition QueryCondition + FieldsValue map[string]interface{} + Operate TranOperate + Table string + type TranEntityResult struct + Entity TranEntity + func NewTranAEntity(table string, fieldsValue interface{}) TranEntityResult + func NewTranDEntity(table string, cond QueryCondition) TranEntityResult + func NewTranUEntity(table string, fieldsValue interface{}, cond QueryCondition) TranEntityResult + type TranOperate byte + const TA + const TD + const TU + type TranProvider interface + Exec func(TranEntity) TranResult + ExecTrans func([]TranEntity) TranResult + type TranResult struct + Result int64 + func Exec(entity TranEntity) TranResult + func ExecTrans(entities []TranEntity) TranResult