Documentation ¶
Index ¶
- Constants
- Variables
- func AnyFromAny[T any](val T) any
- func AnyFromMap[K comparable, V any](val map[K]V) any
- func AnyFromObject[T any](val *T) any
- func AnyFromSlice[T any](val []T) any
- func AnyFromStampInt64(val int64) any
- func RawToBinary(val sql.RawBytes) ([]byte, error)
- func RawToBool(val sql.RawBytes) (bool, error)
- func RawToFloat32(val sql.RawBytes) (float32, error)
- func RawToFloat64(val sql.RawBytes) (float64, error)
- func RawToInt16(val sql.RawBytes) (int16, error)
- func RawToInt32(val sql.RawBytes) (int32, error)
- func RawToInt64(val sql.RawBytes) (int64, error)
- func RawToInt8(val sql.RawBytes) (int8, error)
- func RawToMap[K comparable, V any](val sql.RawBytes) (map[K]V, error)
- func RawToObject[T any](val sql.RawBytes) (*T, error)
- func RawToSlice[T any](val sql.RawBytes) ([]T, error)
- func RawToStampInt64(val sql.RawBytes) (int64, error)
- func RawToString(val sql.RawBytes) (string, error)
- func RawToUint16(val sql.RawBytes) (uint16, error)
- func RawToUint32(val sql.RawBytes) (uint32, error)
- func RawToUint64(val sql.RawBytes) (uint64, error)
- func RawToUint8(val sql.RawBytes) (uint8, error)
- func SyncTableColumns(ctx context.Context, db *sqlx.DB, tableName string, createTable string, ...) (err error)
- func SyncTableIndex(ctx context.Context, db *sqlx.DB, tableName string, alterSql map[string]string) (err error)
- type DatabaseService
- type EmptyResult
- type IntSignedCondition
- func (c *IntSignedCondition[T, V]) Between(min, max V) *T
- func (c *IntSignedCondition[T, V]) Equal(v V) *T
- func (c *IntSignedCondition[T, V]) GreaterEqual(v V) *T
- func (c *IntSignedCondition[T, V]) GreaterThen(v V) *T
- func (c *IntSignedCondition[T, V]) In(vals ...V) *T
- func (c *IntSignedCondition[T, V]) LessEqual(v V) *T
- func (c *IntSignedCondition[T, V]) LessThen(v V) *T
- func (c *IntSignedCondition[T, V]) NotEqual(v V) *T
- type IntUnSignedCondition
- func (c *IntUnSignedCondition[T, V]) Between(min, max V) *T
- func (c *IntUnSignedCondition[T, V]) Equal(v V) *T
- func (c *IntUnSignedCondition[T, V]) GreaterEqual(v V) *T
- func (c *IntUnSignedCondition[T, V]) GreaterThen(v V) *T
- func (c *IntUnSignedCondition[T, V]) In(vals ...V) *T
- func (c *IntUnSignedCondition[T, V]) LessEqual(v V) *T
- func (c *IntUnSignedCondition[T, V]) LessThen(v V) *T
- func (c *IntUnSignedCondition[T, V]) NotEqual(v V) *T
- type StringCondition
Constants ¶
View Source
const ( Columns = "__COLUMNS__" TableName = "__TABLE__" )
Variables ¶
View Source
var RegisterDB func(driver, db, tblName string, swapDB func(db *sqlx.DB) error) = svc.RegisterDB
RegisterDB 注册数据库相关接口
View Source
var RegisterSyncDBTable = func(driver, db, tblName string, syncFunc func(ctx context.Context, db *sqlx.DB) (err error)) {
}
View Source
var SyncTableColumnsAndIndex = true
SyncTableColumnsAndIndex 服务启动自动同步表字段级索引信息
Functions ¶
func AnyFromAny ¶
func AnyFromStampInt64 ¶
Types ¶
type DatabaseService ¶
type DatabaseService struct { app.NoopService // contains filtered or unexported fields }
DatabaseService mysql链接管理
func NewService ¶
func NewService() *DatabaseService
func (*DatabaseService) Name ¶
func (svc *DatabaseService) Name() string
func (*DatabaseService) RegisterDB ¶
func (svc *DatabaseService) RegisterDB(driver, db, tblName string, swapDB func(db *sqlx.DB) error)
func (*DatabaseService) Stop ¶
func (svc *DatabaseService) Stop()
type EmptyResult ¶
type EmptyResult struct{}
func (EmptyResult) LastInsertId ¶
func (EmptyResult) LastInsertId() (int64, error)
LastInsertId returns the integer generated by the database in response to a command. Typically this will be from an "auto increment" column when inserting a new row. Not all databases support this feature, and the syntax of such statements varies.
func (EmptyResult) RowsAffected ¶
func (EmptyResult) RowsAffected() (int64, error)
RowsAffected returns the number of rows affected by an update, insert, or delete. Not every database or database driver may support this.
type IntSignedCondition ¶
type IntSignedCondition[T any, V int | int8 | int16 | int32 | int64] struct { // contains filtered or unexported fields }
func NewIntSignedCondition ¶
func (*IntSignedCondition[T, V]) Between ¶
func (c *IntSignedCondition[T, V]) Between(min, max V) *T
func (*IntSignedCondition[T, V]) Equal ¶
func (c *IntSignedCondition[T, V]) Equal(v V) *T
func (*IntSignedCondition[T, V]) GreaterEqual ¶
func (c *IntSignedCondition[T, V]) GreaterEqual(v V) *T
func (*IntSignedCondition[T, V]) GreaterThen ¶
func (c *IntSignedCondition[T, V]) GreaterThen(v V) *T
func (*IntSignedCondition[T, V]) In ¶
func (c *IntSignedCondition[T, V]) In(vals ...V) *T
func (*IntSignedCondition[T, V]) LessEqual ¶
func (c *IntSignedCondition[T, V]) LessEqual(v V) *T
func (*IntSignedCondition[T, V]) LessThen ¶
func (c *IntSignedCondition[T, V]) LessThen(v V) *T
func (*IntSignedCondition[T, V]) NotEqual ¶
func (c *IntSignedCondition[T, V]) NotEqual(v V) *T
type IntUnSignedCondition ¶
type IntUnSignedCondition[T any, V uint | uint8 | uint16 | uint32 | uint64] struct { // contains filtered or unexported fields }
func NewIntUnSignedCondition ¶
func (*IntUnSignedCondition[T, V]) Between ¶
func (c *IntUnSignedCondition[T, V]) Between(min, max V) *T
func (*IntUnSignedCondition[T, V]) Equal ¶
func (c *IntUnSignedCondition[T, V]) Equal(v V) *T
func (*IntUnSignedCondition[T, V]) GreaterEqual ¶
func (c *IntUnSignedCondition[T, V]) GreaterEqual(v V) *T
func (*IntUnSignedCondition[T, V]) GreaterThen ¶
func (c *IntUnSignedCondition[T, V]) GreaterThen(v V) *T
func (*IntUnSignedCondition[T, V]) In ¶
func (c *IntUnSignedCondition[T, V]) In(vals ...V) *T
func (*IntUnSignedCondition[T, V]) LessEqual ¶
func (c *IntUnSignedCondition[T, V]) LessEqual(v V) *T
func (*IntUnSignedCondition[T, V]) LessThen ¶
func (c *IntUnSignedCondition[T, V]) LessThen(v V) *T
func (*IntUnSignedCondition[T, V]) NotEqual ¶
func (c *IntUnSignedCondition[T, V]) NotEqual(v V) *T
type StringCondition ¶
type StringCondition[T any] struct { // contains filtered or unexported fields }
func NewStringCondition ¶
func NewStringCondition[T any](w *T, buf *util.Builder, name string) *StringCondition[T]
func (*StringCondition[T]) Equal ¶
func (c *StringCondition[T]) Equal(v string) *T
func (*StringCondition[T]) In ¶
func (c *StringCondition[T]) In(vals ...string) *T
func (*StringCondition[T]) Like ¶
func (c *StringCondition[T]) Like(v string) *T
func (*StringCondition[T]) NotEqual ¶
func (c *StringCondition[T]) NotEqual(v string) *T
Directories ¶
Path | Synopsis |
---|---|
example
|
|
dbop/db_user
Code generated by wpb.
|
Code generated by wpb. |
Code generated by "gogen cfggen"; DO NOT EDIT.
|
Code generated by "gogen cfggen"; DO NOT EDIT. |
Click to show internal directories.
Click to hide internal directories.