Documentation ¶
Index ¶
- Constants
- Variables
- func Alias(funcStr, alias string) string
- func Use(funcName string, args ...interface{}) (funcStr string, err error)
- type Engine
- func (engine *Engine) Column(columns ...string) *Session
- func (engine *Engine) Exec(query string, args ...interface{}) (sql.Result, error)
- func (engine *Engine) GroupBy(groupBys ...string) *Session
- func (engine *Engine) Having(pred string, rest ...interface{}) *Session
- func (engine *Engine) Join(join string, rest ...interface{}) *Session
- func (engine *Engine) LeftJoin(join string, rest ...interface{}) *Session
- func (engine *Engine) Limit(limit int64, offset ...int64) *Session
- func (engine *Engine) NewSession() *Session
- func (engine *Engine) NotFromTable() *Session
- func (engine *Engine) Options(options ...string) *Session
- func (engine *Engine) Order(orderBys ...string) *Session
- func (engine *Engine) RightJoin(join string, rest ...interface{}) *Session
- func (engine *Engine) Table(name string) *Session
- func (engine *Engine) UseFunc(funcName, alias string, args ...interface{}) *Session
- func (engine *Engine) Values(values ...interface{}) *Session
- func (engine *Engine) Where(pred string, args ...interface{}) *Session
- type Session
- func (session *Session) Clone() *Session
- func (session *Session) Close()
- func (session *Session) Column(columns ...string) *Session
- func (session *Session) DB() *sqlx.DB
- func (session *Session) Exec(query string, args ...interface{}) (sql.Result, error)
- func (session *Session) Find(obj interface{}) (err error)
- func (session *Session) FindWithSql(obj interface{}, query string, args ...interface{}) (err error)
- func (session *Session) GenFindSQL(obj interface{}) *Session
- func (session *Session) GenInsertSQL(obj interface{}) *Session
- func (session *Session) GetBySQL(dest interface{}, query string, args ...interface{}) (err error)
- func (session *Session) GroupBy(groupBys ...string) *Session
- func (session *Session) Having(pred string, rest ...interface{}) *Session
- func (session *Session) ID(id uint64) *Session
- func (session *Session) Init()
- func (session *Session) Insert(bean interface{}) (err error)
- func (session *Session) Join(join string, rest ...interface{}) *Session
- func (session *Session) LeftJoin(join string, rest ...interface{}) *Session
- func (session *Session) Limit(limit int64, offset ...int64) *Session
- func (session *Session) NotFromTable() *Session
- func (session *Session) Options(options ...string) *Session
- func (session *Session) Order(orderBys ...string) *Session
- func (session *Session) RightJoin(join string, rest ...interface{}) *Session
- func (session *Session) SelectBySQL(dest interface{}, query string, args ...interface{}) (err error)
- func (session *Session) Table(from string) *Session
- func (session *Session) ToSql() (sql string)
- func (session *Session) UseFunc(funcName, alias string, args ...interface{}) *Session
- func (session *Session) Values(values ...interface{}) *Session
- func (session *Session) Where(pred string, args ...interface{}) *Session
Constants ¶
View Source
const ( Plus = "plus" Minus = "minus" Multiply = "multiply" Divide = "divide" IntDiv = "intDiv" IntDivOrZero = "intDivOrZero" Modulo = "modulo" Negate = "negate" Abs = "abs" Gcd = "gcd" Lcm = "lcm" )
Arithmetic functions
For all arithmetic functions, the result type is calculated as the smallest number type that the result fits in, if there is such a type. The minimum is taken simultaneously based on the number of bits, whether it is signed, and whether it floats. If there are not enough bits, the highest bit type is taken.
View Source
const ( BitAnd = "bitAnd" //bitOr(a, b) BitOr = "bitOr" //bitXor(a, b) BitXor = "bitXor" //bitNot(a) BitNot = "bitNot" //bitShiftLeft(a, b) BitShiftLeft = "bitShiftLeft" //bitShiftRight(a, b) BitShiftRight = "bitShiftRight" //bitRotateLeft(a, b) BitRotateLeft = "bitRotateLeft" //bitRotateRight(a, b) BitRotateRight = "bitRotateRight" //bitTest(a, b) BitTest = "bitTest" //bitTestAll(a, b) BitTestAll = "bitTestAll" //bitTestAny(a, b) BitTestAny = "bitTestAny" )
Bit functions
View Source
const ( Hex = "hex" Unhex = "unhex" UUIDStringToNum = "UUIDStringToNum" UUIDNumToString = "UUIDNumToString" BitmaskToList = "bitmaskToList" BitmaskToArray = "bitmaskToArray" )
Encoding functions
View Source
const ( E = "e" Pi = "pi" Exp = "exp" Log = "log" Ln = "ln" Exp2 = "exp2" Log2 = "log2" Exp10 = "exp10" Log10 = "log10" Sqrt = "sqrt" Cbrt = "cbrt" Erf = "erf" Erfc = "erfc" Lgamma = "lgamma" Tgamma = "tgamma" Sin = "sin" Cos = "cos" Tan = "tan" Asin = "asin" Acos = "acos" Atan = "atan" Pow = "pow" Power = "power" IntExp2 = "intExp2" IntExp10 = "intExp10" )
Variables ¶
View Source
var ( ErrorWithoutPrepare = errors.New("error: prepare is false") ErrorWithoutStmt = errors.New("error: stmt is nil") ErrParamsType = errors.New("error: param type error") ErrTableNotFound = errors.New("error: table not found") ErrNotSupportInsertType = errors.New("error: not support type") ErrNotSupportFindType = errors.New("error: not support type") )
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) NewSession ¶
func (*Engine) NotFromTable ¶
NotFromTable 如果使用函数生成,不从表中读取数据
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) FindWithSql ¶
FindWithSql 使用定义的sql去查询结果
func (*Session) GenFindSQL ¶
GenFindSQL 生成查询使用的代码
func (*Session) GenInsertSQL ¶
func (*Session) NotFromTable ¶
NotFromTable 如果使用函数生成,不从表中读取数据
func (*Session) SelectBySQL ¶
Click to show internal directories.
Click to hide internal directories.