Documentation ¶
Index ¶
- func BoolScan(src interface{}) (interface{}, error)
- func ByteArrayScan(src interface{}) (interface{}, error)
- func Float32Scan(src interface{}) (interface{}, error)
- func Float32ToBytes(float float32) []byte
- func Float32fromBytes(bytes []byte) float32
- func Float32fromString(data string) (float32, error)
- func Float64Scan(src interface{}) (interface{}, error)
- func Float64ToBytes(float float64) []byte
- func Float64fromBytes(bytes []byte) float64
- func Float64fromString(data string) (float64, error)
- func Int16fromString(data string) (int16, error)
- func Int32FromBytes(buf []byte) int32
- func Int32Scan(src interface{}) (interface{}, error)
- func Int32fromString(data string) (int32, error)
- func Int64FromBytes(buf []byte) int64
- func Int64Scan(src interface{}) (interface{}, error)
- func Int64ToBytes(i int64) []byte
- func Int64fromString(data string) (int64, error)
- func Int8fromString(data string) (int8, error)
- func IntfromString(data string) (int, error)
- func IsEmpty(v interface{}) bool
- func Register(name string, factory SqlFactory)
- func StringScan(src interface{}) (interface{}, error)
- func Stringfrombytes(data []byte) string
- func TimeFromString(data string) (time.Time, error)
- func TimeScan(src interface{}) (interface{}, error)
- func UInt16fromString(data string) (uint16, error)
- func UInt32fromString(data string) (uint32, error)
- func UInt64fromString(data string) (uint64, error)
- func UInt8fromString(data string) (uint8, error)
- func UIntfromString(data string) (uint, error)
- type Column
- type Condition
- type CreateSql
- type Db
- func (this Db) Clone() Db
- func (this Db) Count(columnName string, table string) (int64, error)
- func (thiz Db) Delete(vs ...interface{}) (int, error)
- func (thiz Db) Insert(vs ...interface{}) (int, error)
- func (thiz Db) InsertIgnore(vs ...interface{}) (int, error)
- func (this Db) RawDb() *sql.DB
- func (thiz Db) Replace(vs ...interface{}) (int, error)
- func (thiz Db) Select(vs interface{}, nameFilters ...string) (interface{}, error)
- func (this Db) SelectWithModel(model TableModel, vs interface{}) (interface{}, error)
- func (thiz Db) Update(vs interface{}, nameFilters ...string) (int, error)
- func (thiz Db) Update2(vs ...interface{}) (int, error)
- func (this Db) Where(sql string, patches ...interface{}) Db
- func (this Db) Where2(cnd Condition) Db
- func (this Db) WorkInTransaction(work TransactionWork) (int, error)
- type IScanner
- type ISqlGenerator
- type LinkType
- type Object
- type Order
- type OrderType
- type Orders
- type Pager
- type Pagers
- type ScanFunc
- type Scanner
- type SqlFactory
- type TableModel
- type TransactionWork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayScan ¶
func ByteArrayScan(src interface{}) (interface{}, error)
func Float32Scan ¶
func Float32Scan(src interface{}) (interface{}, error)
func Float32ToBytes ¶
func Float32fromBytes ¶
func Float32fromString ¶
func Float64Scan ¶
func Float64Scan(src interface{}) (interface{}, error)
func Float64ToBytes ¶
func Float64fromBytes ¶
func Float64fromString ¶
func Int16fromString ¶
func Int32FromBytes ¶
func Int32fromString ¶
func Int64FromBytes ¶
func Int64ToBytes ¶
func Int64fromString ¶
func Int8fromString ¶
func IntfromString ¶
func Register ¶
func Register(name string, factory SqlFactory)
func StringScan ¶
func StringScan(src interface{}) (interface{}, error)
func Stringfrombytes ¶
func UInt16fromString ¶
func UInt32fromString ¶
func UInt64fromString ¶
func UInt8fromString ¶
func UIntfromString ¶
Types ¶
type Column ¶
type Condition ¶
type Condition interface { Items() []_ConditionItem Values() []interface{} Pager() Pager Order() Order NotNull() bool Or(sql string, values ...interface{}) Condition And(sql string, values ...interface{}) Condition AndIn(name string, values ...interface{}) Condition AndNotIn(name string, values ...interface{}) Condition OrIn(name string, values ...interface{}) Condition OrNotIn(name string, values ...interface{}) Condition Page(index int, size int) Condition Limit(index int, size int) Condition OrderBy(name string, tp OrderType) Condition }
type CreateSql ¶
type CreateSql func(TableModel, Condition) (string, []interface{})
type Db ¶
func OpenWithConfig ¶
func (Db) InsertIgnore ¶
func (Db) SelectWithModel ¶
func (this Db) SelectWithModel(model TableModel, vs interface{}) (interface{}, error)
func (Db) WorkInTransaction ¶
func (this Db) WorkInTransaction(work TransactionWork) (int, error)
type ISqlGenerator ¶
type SqlFactory ¶
type SqlFactory interface { Insert(TableModel, Condition) (string, []interface{}) InsertIgnore(TableModel, Condition) (string, []interface{}) Replace(TableModel, Condition) (string, []interface{}) Update(TableModel, Condition) (string, []interface{}) Delete(TableModel, Condition) (string, []interface{}) Query(TableModel, Condition) (string, []interface{}) }
type TableModel ¶
type TableModel struct { Type reflect.Type Value reflect.Value TableName string ColumnNames []string Columns map[string]Column Primary Column }
func CreateSingleValueTableModel ¶
func CreateSingleValueTableModel(v interface{}, table string, field string) TableModel
func GetTableModel ¶
func GetTableModel(v interface{}, columns ...string) (TableModel, error)
func (TableModel) Clone ¶
func (this TableModel) Clone(value reflect.Value, columnFilters ...string) TableModel
func (TableModel) ColumnsValues ¶
func (model TableModel) ColumnsValues() []interface{}
func (TableModel) GetPrimary ¶
func (m TableModel) GetPrimary() interface{}
func (TableModel) GetPrimaryCondition ¶
func (m TableModel) GetPrimaryCondition() Condition
func (TableModel) InsertValues ¶
func (mo TableModel) InsertValues() []interface{}
type TransactionWork ¶
Click to show internal directories.
Click to hide internal directories.