Documentation ¶
Index ¶
- Variables
- func Batch(ormArray ...*OrmModel) error
- func BatchArray(ormArray []*OrmModel) error
- func BatchFunc(f func(tx *sqlx.Tx)) error
- func BindDB(DB *sqlx.DB) error
- func ConvertArray[T int | string](array []T) []string
- func NamedExec(sqlStr string, params map[string]interface{}) error
- func NamedQuery(query string, params any, dest any) error
- func Query(query string, dest any) error
- func RawSQL(sql string, args ...interface{}) error
- func StructToMap(item interface{}) (map[string]interface{}, map[string]string)
- func UnmarshalGetPath(json []byte, val interface{}, path ...interface{}) error
- type CRUDInterface
- type ConditionGroup
- func And(jsonTag ...string) ConditionGroup
- func And2F(jsonTag string, arg any) ConditionGroup
- func Exp(express string, args ...any) ConditionGroup
- func IN[T int | string](jsonTag string, args ...T) ConditionGroup
- func ISNull(jsonTag ...string) ConditionGroup
- func ISNullOr(jsonTag ...string) ConditionGroup
- func Or(jsonTag ...string) ConditionGroup
- func Or2F(jsonTag string, args ...any) ConditionGroup
- type ORMInterface
- type OrmModel
- func (o *OrmModel) Asc(jsonTag ...string) *OrmModel
- func (o *OrmModel) Count(column string) (int64, error)
- func (o *OrmModel) Delete(i interface{}) *OrmModel
- func (o *OrmModel) Desc(jsonTag ...string) *OrmModel
- func (o *OrmModel) EmptyKey(f bool) *OrmModel
- func (o *OrmModel) Error() error
- func (o *OrmModel) Exclude(jsonTag ...string) *OrmModel
- func (o *OrmModel) Exec() error
- func (o *OrmModel) Fields(jsonTag ...string) *OrmModel
- func (o *OrmModel) Get(dest interface{}) error
- func (o *OrmModel) If(ifFunc func(o *OrmModel)) *OrmModel
- func (o *OrmModel) Insert(i interface{}) *OrmModel
- func (o *OrmModel) JsonbList(dest interface{}) error
- func (o *OrmModel) JsonbListString() (string, error)
- func (o *OrmModel) JsonbMap(dest interface{}, columns ...string) error
- func (o *OrmModel) JsonbMapString(keys ...string) (string, error)
- func (o *OrmModel) Limit(row int64) *OrmModel
- func (o *OrmModel) List(dest interface{}) error
- func (o *OrmModel) Log(l bool) *OrmModel
- func (o *OrmModel) NamedSQL() string
- func (o *OrmModel) Offset(row int64) *OrmModel
- func (o *OrmModel) RETURNING(single any, list any, jsonTag ...string) error
- func (o *OrmModel) SQL() string
- func (o *OrmModel) Select(i interface{}) *OrmModel
- func (o *OrmModel) Update(i interface{}) *OrmModel
- func (o *OrmModel) Where(cgs ...ConditionGroup) *OrmModel
- func (o *OrmModel) WherePK() *OrmModel
- func (o *OrmModel) With(t string) *OrmModel
- func (o *OrmModel) WithAsc(fields ...string) *OrmModel
- func (o *OrmModel) WithDesc(fields ...string) *OrmModel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SqlxDB *sqlx.DB TagName = "db" )
Functions ¶
func BatchArray ¶
func ConvertArray ¶ added in v0.1.6
func StructToMap ¶
func UnmarshalGetPath ¶
Types ¶
type CRUDInterface ¶
type ConditionGroup ¶
type ConditionGroup struct { Logic string JsonTags []string Args []any InArgs []string NamedExpress string IsNull bool }
func And ¶
func And(jsonTag ...string) ConditionGroup
func And2F ¶
func And2F(jsonTag string, arg any) ConditionGroup
func Exp ¶
func Exp(express string, args ...any) ConditionGroup
Exp 条件表达式 {table_column_field}=:{name}
func Or ¶
func Or(jsonTag ...string) ConditionGroup
func Or2F ¶
func Or2F(jsonTag string, args ...any) ConditionGroup
func (ConditionGroup) Transform ¶
func (cg ConditionGroup) Transform() string
type ORMInterface ¶
type ORMInterface interface {
TableName() string
}
type OrmModel ¶
type OrmModel struct {
// contains filtered or unexported fields
}
func DELETE ¶
func DELETE(i ORMInterface) *OrmModel
func INSERT ¶
func INSERT(i ORMInterface) *OrmModel
func SELECT ¶
func SELECT(i ORMInterface) *OrmModel
func UPDATE ¶
func UPDATE(i ORMInterface) *OrmModel
func (*OrmModel) JsonbListString ¶
func (*OrmModel) Where ¶
func (o *OrmModel) Where(cgs ...ConditionGroup) *OrmModel
Click to show internal directories.
Click to hide internal directories.