Documentation ¶
Index ¶
- Variables
- func ArrayIntersect(slice1, slice2 []string) []string
- func ArrayIntersect2(slice1, slice2 []string) ([]string, []string, []string)
- func ArrayOf(i ...interface{}) []interface{}
- func ByteArrayScan(src interface{}) (interface{}, error)
- func CamelToSnakeString(s string) string
- func Cnd(field string, operation define.Operation, values ...interface{}) define.Condition
- func CndEmpty() define.Condition
- func CndEq(field string, value interface{}) define.Condition
- func CndFull(linker define.Linker, field string, operation define.Operation, ...) define.Condition
- func CndGe(field string, value interface{}) define.Condition
- func CndGt(field string, value interface{}) define.Condition
- func CndIn(field string, values ...interface{}) define.Condition
- func CndIsNotNull(field string) define.Condition
- func CndIsNull(field string) define.Condition
- func CndLe(field string, value interface{}) define.Condition
- func CndLike(field string, value interface{}) define.Condition
- func CndLikeIgnoreEnd(field string, value interface{}) define.Condition
- func CndLikeIgnoreStart(field string, value interface{}) define.Condition
- func CndLt(field string, value interface{}) define.Condition
- func CndNotEq(field string, value interface{}) define.Condition
- func CndNotIn(field string, values ...interface{}) define.Condition
- func CndRaw(rawExpresssion string, values ...interface{}) define.Condition
- func Float32Scan(src interface{}) (interface{}, error)
- func GenDefaultStructFromDatabase(db *DB, packageName string, fileName string, tables ...string) error
- func GetColumns(v reflect.Value) ([]string, []string, []string, map[string]string)
- func IntScan(src interface{}) (interface{}, error)
- func MakeOrderBy(name string, orderType define.OrderType) define.OrderBy
- func MakePage(page int64, size int64) define.PageInfo
- func MapToCondition(maps map[string]interface{}) define.Condition
- func Md5Text(str string) string
- func ScannerResultToStruct(t reflect.Type, scanners []interface{}, columnNames []string) reflect.Value
- func SliceToGroupSlice(vs interface{}) map[string][]interface{}
- func StructToCondition(vs interface{}, columns ...string) define.Condition
- func StructToMap(vs interface{}, columns ...string) (map[string]interface{}, error)
- func UnZipSlice(vs interface{}) []any
- func UnderscoreToUpperCamelCase(s string) string
- type CndImpl
- func (c *CndImpl) And(field string, operation define.Operation, value ...interface{}) define.Condition
- func (c *CndImpl) And2(condition define.Condition) define.Condition
- func (c *CndImpl) And3(rawExpresssion string, values ...interface{}) define.Condition
- func (c *CndImpl) And3Bool(b bool, rawExpresssion string, values ...interface{}) define.Condition
- func (c *CndImpl) AndBool(b bool, field string, operation define.Operation, values ...interface{}) define.Condition
- func (c *CndImpl) Eq(field string, values interface{}) define.Condition
- func (c *CndImpl) EqBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) Field() string
- func (c *CndImpl) Ge(field string, values interface{}) define.Condition
- func (c *CndImpl) GeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) Gt(field string, values interface{}) define.Condition
- func (c *CndImpl) GtBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) HasSubConditions() bool
- func (c *CndImpl) In(field string, values ...interface{}) define.Condition
- func (c *CndImpl) InBool(b bool, field string, values ...interface{}) define.Condition
- func (c *CndImpl) IsNotNull(field string) define.Condition
- func (c *CndImpl) IsNotNullBool(b bool, filed string) define.Condition
- func (c *CndImpl) IsNull(filed string) define.Condition
- func (c *CndImpl) IsNullBool(b bool, field string) define.Condition
- func (c *CndImpl) Items() []define.Condition
- func (c *CndImpl) Le(field string, values interface{}) define.Condition
- func (c *CndImpl) LeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) Like(field string, values interface{}) define.Condition
- func (c *CndImpl) LikeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) LikeIgnoreEnd(field string, values interface{}) define.Condition
- func (c *CndImpl) LikeIgnoreEndBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) LikeIgnoreStart(field string, values interface{}) define.Condition
- func (c *CndImpl) LikeIgnoreStartBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) Linker() define.Linker
- func (c *CndImpl) Lt(field string, values interface{}) define.Condition
- func (c *CndImpl) LtBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) NotEq(field string, values interface{}) define.Condition
- func (c *CndImpl) NotEqBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) NotIn(field string, values ...interface{}) define.Condition
- func (c *CndImpl) NotInBool(b bool, field string, values ...interface{}) define.Condition
- func (c *CndImpl) NotLike(field string, values interface{}) define.Condition
- func (c *CndImpl) NotLikeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) Operation() define.Operation
- func (c *CndImpl) Or(field string, operation define.Operation, values ...interface{}) define.Condition
- func (c *CndImpl) Or2(condition define.Condition) define.Condition
- func (c *CndImpl) Or3(rawExpresssion string, values ...interface{}) define.Condition
- func (c *CndImpl) Or3Bool(b bool, rawExpresssion string, values ...interface{}) define.Condition
- func (c *CndImpl) OrBool(b bool, field string, operation define.Operation, values ...interface{}) define.Condition
- func (c *CndImpl) OrEq(field string, values interface{}) define.Condition
- func (c *CndImpl) OrEqBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrGe(field string, values interface{}) define.Condition
- func (c *CndImpl) OrGeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrGt(field string, values interface{}) define.Condition
- func (c *CndImpl) OrGtBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrIn(field string, values ...interface{}) define.Condition
- func (c *CndImpl) OrInBool(b bool, field string, values ...interface{}) define.Condition
- func (c *CndImpl) OrIsNotNull(field string) define.Condition
- func (c *CndImpl) OrIsNotNullBool(b bool, field string) define.Condition
- func (c *CndImpl) OrIsNull(field string) define.Condition
- func (c *CndImpl) OrIsNullBool(b bool, field string) define.Condition
- func (c *CndImpl) OrLe(field string, values interface{}) define.Condition
- func (c *CndImpl) OrLeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrLike(field string, values interface{}) define.Condition
- func (c *CndImpl) OrLikeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrLikeIgnoreEnd(field string, values interface{}) define.Condition
- func (c *CndImpl) OrLikeIgnoreEndBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrLikeIgnoreStart(field string, values interface{}) define.Condition
- func (c *CndImpl) OrLikeIgnoreStartBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrLt(field string, values interface{}) define.Condition
- func (c *CndImpl) OrLtBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrNotEq(field string, values interface{}) define.Condition
- func (c *CndImpl) OrNotEqBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) OrNotIn(field string, values ...interface{}) define.Condition
- func (c *CndImpl) OrNotInBool(b bool, field string, values ...interface{}) define.Condition
- func (c *CndImpl) OrNotLike(field string, values interface{}) define.Condition
- func (c *CndImpl) OrNotLikeBool(b bool, field string, values interface{}) define.Condition
- func (c *CndImpl) PayLoads() int64
- func (c *CndImpl) RawExpression() string
- func (c *CndImpl) SetValues(values []interface{})
- func (c *CndImpl) Values() []interface{}
- type CommonSqlResult
- type CountResult
- type CountScanner
- type DB
- func (db *DB) Begin() error
- func (db *DB) CleanDb() *DB
- func (db *DB) CleanOrders() *DB
- func (db DB) Clone() DB
- func (db *DB) Commit()
- func (db DB) Count(columnName string) (int64, error)
- func (db *DB) Delete(vs ...interface{}) (sql.Result, error)
- func (db *DB) DoTransaction(work TransactionWork) (interface{}, error)
- func (db *DB) ExecuteRaw(rawSql string, datas ...any) (sql.Result, error)
- func (db *DB) ExecuteStatement(statement string, data ...any) (sql.Result, error)
- func (db DB) Factory() define.SqlFactory
- func (db *DB) First(vs interface{}) (interface{}, error)
- func (db DB) GetColumns(table string) ([]define.Column, error)
- func (db *DB) GetCondition() define.Condition
- func (db DB) GetCurrentSchema() (string, error)
- func (db *DB) GetOrderBys() []define.OrderBy
- func (db *DB) GetPage() (int64, int64)
- func (db *DB) GetPageInfo() define.PageInfo
- func (db DB) GetRawDb() *sql.DB
- func (db DB) GetTable() string
- func (db DB) GetTableStruct(table string) (define.ITableStruct, error)
- func (db DB) GetTableStruct2(i any) (define.ITableStruct, error)
- func (db DB) GetTables() ([]string, error)
- func (db *DB) Insert(v interface{}, columns ...string) (sql.Result, error)
- func (db *DB) IsInTransaction() bool
- func (db *DB) OrderBy(field string, t define.OrderType) *DB
- func (db *DB) OrderByAsc(field string) *DB
- func (db *DB) OrderByDesc(field string) *DB
- func (db *DB) OrderBys(orderbys []define.OrderBy) *DB
- func (db *DB) Page(page int64, pageSize int64) *DB
- func (db *DB) RawSql(sql string, datas ...any) *DB
- func (db *DB) Rollback()
- func (db *DB) Select(vs any, columns ...string) (interface{}, error)
- func (db *DB) Sum(columnName string) (int64, error)
- func (db *DB) Table(table string) *DB
- func (db *DB) Update(v interface{}, columns ...string) (sql.Result, error)
- func (db *DB) Where(cnd define.Condition) *DB
- func (db *DB) Where2(sql string, patches ...interface{}) *DB
- type DefaultModel
- func (d DefaultModel) Clone() define.TableModel
- func (d DefaultModel) ColumnDataMap() map[string]interface{}
- func (d DefaultModel) Columns() []string
- func (d DefaultModel) Condition() define.Condition
- func (d DefaultModel) OrderBys() []define.OrderBy
- func (d DefaultModel) Page() define.PageInfo
- func (d DefaultModel) PrimaryAuto() []string
- func (d DefaultModel) PrimaryKeys() []string
- func (d *DefaultModel) SetColumns(columns []string) error
- func (d DefaultModel) Table() string
- type DefaultScanner
- type EmptyScanner
- type FieldInfo
- type IRowScanner
- type IScanner
- type ITableName
- type OrderByImpl
- type PageImpl
- type RawMetaInfo
- type ScanFunc
- type ScannerGenerateFunc
- type ScannerImpl
- type TransactionWork
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug bool
Functions ¶
func ArrayIntersect ¶
func ByteArrayScan ¶
func ByteArrayScan(src interface{}) (interface{}, error)
func CamelToSnakeString ¶
func CndIsNotNull ¶
func CndLikeIgnoreEnd ¶
func CndLikeIgnoreStart ¶
func Float32Scan ¶
func Float32Scan(src interface{}) (interface{}, error)
func GenDefaultStructFromDatabase ¶ added in v3.0.3
func GetColumns ¶ added in v3.0.1
func MapToCondition ¶
func ScannerResultToStruct ¶
func SliceToGroupSlice ¶
func SliceToGroupSlice(vs interface{}) map[string][]interface{}
func StructToCondition ¶
func StructToMap ¶
func UnZipSlice ¶
func UnZipSlice(vs interface{}) []any
func UnderscoreToUpperCamelCase ¶ added in v3.0.3
下划线单词转为大写驼峰单词
Types ¶
type CndImpl ¶
type CndImpl struct {
// contains filtered or unexported fields
}
func (*CndImpl) HasSubConditions ¶
func (*CndImpl) IsNotNullBool ¶
func (*CndImpl) LikeIgnoreEnd ¶
func (*CndImpl) LikeIgnoreEndBool ¶
func (*CndImpl) LikeIgnoreStart ¶
func (*CndImpl) LikeIgnoreStartBool ¶
func (*CndImpl) NotLikeBool ¶ added in v3.0.2
func (*CndImpl) OrIsNotNullBool ¶
func (*CndImpl) OrIsNullBool ¶
func (*CndImpl) OrLikeBool ¶
func (*CndImpl) OrLikeIgnoreEnd ¶
func (*CndImpl) OrLikeIgnoreEndBool ¶
func (*CndImpl) OrLikeIgnoreStart ¶
func (*CndImpl) OrLikeIgnoreStartBool ¶
func (*CndImpl) OrNotEqBool ¶
func (*CndImpl) OrNotInBool ¶
func (*CndImpl) OrNotLikeBool ¶ added in v3.0.2
func (*CndImpl) RawExpression ¶
type CommonSqlResult ¶
type CommonSqlResult struct {
// contains filtered or unexported fields
}
func (CommonSqlResult) LastInsertId ¶
func (c CommonSqlResult) LastInsertId() (int64, error)
func (CommonSqlResult) RowsAffected ¶
func (c CommonSqlResult) RowsAffected() (int64, error)
type CountResult ¶
type CountScanner ¶
type CountScanner struct { }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func OpenWithConfig ¶
func (*DB) CleanOrders ¶
func (*DB) DoTransaction ¶
func (db *DB) DoTransaction(work TransactionWork) (interface{}, error)
func (*DB) ExecuteStatement ¶
func (DB) Factory ¶
func (db DB) Factory() define.SqlFactory
func (DB) GetColumns ¶ added in v3.0.4
func (*DB) GetCondition ¶
func (DB) GetCurrentSchema ¶ added in v3.0.4
func (*DB) GetOrderBys ¶
func (*DB) GetPageInfo ¶
func (DB) GetTableStruct ¶ added in v3.0.12
func (db DB) GetTableStruct(table string) (define.ITableStruct, error)
func (DB) GetTableStruct2 ¶ added in v3.0.13
func (db DB) GetTableStruct2(i any) (define.ITableStruct, error)
func (*DB) IsInTransaction ¶
func (*DB) OrderByAsc ¶
func (*DB) OrderByDesc ¶
type DefaultModel ¶
type DefaultModel struct {
// contains filtered or unexported fields
}
func (DefaultModel) Clone ¶
func (d DefaultModel) Clone() define.TableModel
func (DefaultModel) ColumnDataMap ¶
func (d DefaultModel) ColumnDataMap() map[string]interface{}
func (DefaultModel) Columns ¶
func (d DefaultModel) Columns() []string
func (DefaultModel) Condition ¶
func (d DefaultModel) Condition() define.Condition
func (DefaultModel) OrderBys ¶
func (d DefaultModel) OrderBys() []define.OrderBy
func (DefaultModel) Page ¶
func (d DefaultModel) Page() define.PageInfo
func (DefaultModel) PrimaryAuto ¶ added in v3.0.1
func (d DefaultModel) PrimaryAuto() []string
func (DefaultModel) PrimaryKeys ¶ added in v3.0.1
func (d DefaultModel) PrimaryKeys() []string
func (*DefaultModel) SetColumns ¶ added in v3.0.1
func (d *DefaultModel) SetColumns(columns []string) error
func (DefaultModel) Table ¶
func (d DefaultModel) Table() string
type DefaultScanner ¶
type DefaultScanner struct { RawMetaInfo // contains filtered or unexported fields }
type EmptyScanner ¶
type EmptyScanner struct {
ColName string
}
var EMPTY_SCANNER *EmptyScanner = &EmptyScanner{}
func (EmptyScanner) Scan ¶
func (e EmptyScanner) Scan(_ interface{}) error
type IRowScanner ¶
type IScanner ¶
func GetIScannerOfColumn ¶
func GetIScannerOfColumn(col interface{}) IScanner
type ITableName ¶
type ITableName interface {
TableName() string
}
type OrderByImpl ¶
type OrderByImpl struct {
// contains filtered or unexported fields
}
func (OrderByImpl) Name ¶
func (o OrderByImpl) Name() string
func (OrderByImpl) Type ¶
func (o OrderByImpl) Type() define.OrderType
type RawMetaInfo ¶
type RawMetaInfo struct { reflect.Type TableName string IsSlice bool IsPtr bool IsStruct bool RawData reflect.Value }
func GetRawTableInfo ¶
func GetRawTableInfo(v any) RawMetaInfo
type ScannerGenerateFunc ¶
type ScannerImpl ¶
func (*ScannerImpl) Scan ¶
func (scanner *ScannerImpl) Scan(src interface{}) error
type TransactionWork ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.