Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Expression ¶
type Expression interface {
GetValue() interface{}
}
Expression 表示原生 SQL 表达式片段(等价于 raw 表达式,值直接嵌入语句)。
type GroupLimit ¶
GroupLimit 表示 groupLimit(预加载分组限额)。
type Query ¶
type Query struct {
Aggregate *Aggregate
// Columns: 元素为 string 或 Expression(含子查询 Expression)
Columns []any
// Distinct: bool 或 []any(Postgres distinct on)
Distinct any
// From: string 或 Expression
From any
IndexHint *IndexHint
Joins []*Join
Wheres []*Where
// Groups: 元素为 string 或 Expression
Groups []any
// Havings 与 Where 同构(havings 即 where 数组)
Havings []*Where
Orders []*Order
// Limit/Offset: nil 表示未设置(null)
Limit *int64
Offset *int64
Unions []*Union
UnionOrders []*Order
UnionLimit *int64
UnionOffset *int64
// Lock: nil / bool / string
Lock any
// CTE(with/withRecursive)
Withes []*With
WithRecursive bool
// GroupLimit:预加载分组 limit(compileGroupLimit)
GroupLimit *GroupLimit
// 标记当前 Query 是 join 子句(编译 on 而非 where)
JoinClause bool
// Timeout 查询执行超时(秒),MySQL 编译为 MAX_EXECUTION_TIME 提示。
Timeout *int64
}
type RawExpression ¶
type RawExpression struct {
// contains filtered or unexported fields
}
RawExpression 是 Expression 的默认实现。
func NewExpression ¶
func NewExpression(value interface{}) *RawExpression
func (*RawExpression) GetValue ¶
func (e *RawExpression) GetValue() interface{}
type Where ¶
type Where struct {
Type string
Column any
Operator string
Value any
Values []any
// whereColumn 的两列比较 / whereRowValues 等
First any
Second any
// 括号分组字段(whereBetweenColumns / RowValues 的多列)
Columns []any
// Raw 的 SQL 片段(string 或 Expression)
Sql any
// 嵌套/子查询
Query *Query
// In/Null/Between/Nested 的 not 标记
Not bool
// whereLike 大小写敏感
CaseSensitive bool
// whereFullText 的选项(mode/expanded)
Options map[string]any
Boolean string
}
Click to show internal directories.
Click to hide internal directories.