Documentation ¶
Index ¶
- Constants
- func ErrorF(format string, params ...any) error
- func KeyTo(key string) string
- func ObjTagMap(obj any, tag string) (map[string]interface{}, error)
- type Clause
- type ColObj
- type Engine
- func (e *Engine[T]) And(condition string, vals ...interface{}) *Engine[T]
- func (e *Engine[T]) Clear() *Engine[T]
- func (e *Engine[T]) CloseClause() *Engine[T]
- func (se *Engine[T]) Count() *Engine[T]
- func (e *Engine[T]) Delete() *Engine[T]
- func (e *Engine[T]) Exec() (sql.Result, error)
- func (e *Engine[T]) Find(obj any, columns ...string) error
- func (e *Engine[T]) Get(obj any, columns ...string) error
- func (e *Engine[T]) InsertNamed(tag string, objs ...T) *Engine[T]
- func (e *Engine[T]) Or(condition string, vals ...interface{}) *Engine[T]
- func (e *Engine[T]) Select(columns ...string) *Engine[T]
- func (e *Engine[T]) Set(condition string, vals ...interface{}) *Engine[T]
- func (e *Engine[T]) Update() *Engine[T]
- func (e *Engine[T]) Value() (string, []interface{}, error)
- func (e *Engine[T]) Where(condition string, vals ...interface{}) *Engine[T]
- type GmOrm
- type StringObj
- type TbObj
Constants ¶
View Source
const ( SELECT optionType // 查询 UPDATE // 修改 DELETE // 删除 INSERT // 新增 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clause ¶
type Clause struct { Condition []string // 语句(条件语句或设置语句) xxx = ? | xxx in (?) ... Params []interface{} // 值 End bool // 是否结束当前子句 }
Clause 子句 单个块的子句为 and 当存在多子句时,使用 or 拼接
type Engine ¶
Engine 引擎
func (*Engine[T]) CloseClause ¶
CloseClause 关闭当前子句 用于进入到下一条 or 子句 或 结束当前or子句操作
func (*Engine[T]) InsertNamed ¶
Insert insert named语句生成器(允许生成批量插入) 此方法依据tag获取字段名称,并将依据此tag的值设定为列名进行插入语句生成
Click to show internal directories.
Click to hide internal directories.