Documentation ¶
Overview ¶
Package orm orm Author: Frank Lee Date: 2017-08-01 19:53:05 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-08-01 19:53:21 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-08-01 20:02:22 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-06-01 20:02:27 Last Modified by: Frank Lee Last Modified time: 2018-04-09 22:28:27
Package orm orm Author: Frank Lee Date: 2017-08-01 19:53:05 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-08-01 20:02:41 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-08-01 20:02:45 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Package orm orm Author: Frank Lee Date: 2017-08-01 20:02:48 Last Modified by: Frank Lee Last Modified time: 2018-04-29 22:54
Index ¶
- Variables
- func InitGQL() *gql
- func RegisterDataSource(name, s string, o *Option) error
- type DunplicateDataSourceErr
- type DunplicateSQLIDErr
- type M
- type NoFieldNeedUpdateErr
- type NotSliceInRangeErr
- type NotStructErr
- type Option
- type ParamNotFoundErr
- type PointerParamErr
- type SQLMatchErr
- type Transaction
- func (tran *Transaction) All(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
- func (tran *Transaction) Commit() error
- func (tran *Transaction) Delete(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
- func (tran *Transaction) Error() error
- func (tran *Transaction) Insert(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
- func (tran *Transaction) One(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
- func (tran *Transaction) ShowSQL(b bool) *Transaction
- func (tran *Transaction) Update(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
- type UnknownDataSourceErr
Constants ¶
This section is empty.
Variables ¶
var ( // SHOWSQL whether or not show sql SHOWSQL = false )
Functions ¶
func RegisterDataSource ¶
RegisterDataSource register data source Option is optional name name of data source s uri
Types ¶
type DunplicateDataSourceErr ¶
type DunplicateDataSourceErr struct {
// contains filtered or unexported fields
}
DunplicateDataSourceErr dunplicate data source
func (*DunplicateDataSourceErr) Error ¶
func (err *DunplicateDataSourceErr) Error() string
type DunplicateSQLIDErr ¶
type DunplicateSQLIDErr struct {
// contains filtered or unexported fields
}
DunplicateSQLIDErr dunplicate sql id
func (*DunplicateSQLIDErr) Error ¶
func (err *DunplicateSQLIDErr) Error() string
type NoFieldNeedUpdateErr ¶
type NoFieldNeedUpdateErr struct {
// contains filtered or unexported fields
}
NoFieldNeedUpdateErr no field need to be update in update set clause
func (*NoFieldNeedUpdateErr) Error ¶
func (err *NoFieldNeedUpdateErr) Error() string
type NotSliceInRangeErr ¶
type NotSliceInRangeErr struct {
// contains filtered or unexported fields
}
NotSliceInRangeErr empty slice in range
func (*NotSliceInRangeErr) Error ¶
func (err *NotSliceInRangeErr) Error() string
type NotStructErr ¶
type NotStructErr struct {
// contains filtered or unexported fields
}
NotStructErr not a struct
func (*NotStructErr) Error ¶
func (err *NotStructErr) Error() string
type Option ¶
type Option struct { MaxOpenedConnection int // max open conn MaxIdleConnection int MaxLifeTime int // minutes }
Option option
type ParamNotFoundErr ¶
type ParamNotFoundErr struct {
// contains filtered or unexported fields
}
ParamNotFoundErr params not found in M
func (*ParamNotFoundErr) Error ¶
func (err *ParamNotFoundErr) Error() string
type PointerParamErr ¶
type PointerParamErr struct {
// contains filtered or unexported fields
}
PointerParamErr ResultSet receiver must be a pointer
func (*PointerParamErr) Error ¶
func (err *PointerParamErr) Error() string
type SQLMatchErr ¶
type SQLMatchErr struct {
// contains filtered or unexported fields
}
SQLMatchErr no sql matches sqlID
func (*SQLMatchErr) Error ¶
func (err *SQLMatchErr) Error() string
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction transaction
func (*Transaction) All ¶
func (tran *Transaction) All(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
All select many
func (*Transaction) Delete ¶
func (tran *Transaction) Delete(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
Delete delete
func (*Transaction) Error ¶
func (tran *Transaction) Error() error
Error return the first error in db transaction
func (*Transaction) Insert ¶
func (tran *Transaction) Insert(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
Insert insert
func (*Transaction) One ¶
func (tran *Transaction) One(sqlID string, params M, result interface{}, tableNames map[string]string) (int64, error)
One select one
func (*Transaction) ShowSQL ¶
func (tran *Transaction) ShowSQL(b bool) *Transaction
ShowSQL show sql
type UnknownDataSourceErr ¶
type UnknownDataSourceErr struct {
// contains filtered or unexported fields
}
UnknownDataSourceErr unknown data source
func (*UnknownDataSourceErr) Error ¶
func (err *UnknownDataSourceErr) Error() string