mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-05-19 01:15:40 +08:00
42 lines
693 B
Go
42 lines
693 B
Go
package sqlstmt
|
||
|
||
// TableRef 表示表引用
|
||
type TableRef struct {
|
||
Schema string // 数据库/模式名
|
||
Name string // 表名
|
||
Alias string // 别名
|
||
}
|
||
|
||
// FullName 返回完整表名(含 schema)
|
||
func (t TableRef) FullName() string {
|
||
if t.Schema != "" {
|
||
return t.Schema + "." + t.Name
|
||
}
|
||
return t.Name
|
||
}
|
||
|
||
// Expr 表示表达式(WHERE、ON、HAVING 等)
|
||
type Expr struct {
|
||
Text string // 原始表达式文本
|
||
}
|
||
|
||
// Limit LIMIT/OFFSET
|
||
type Limit struct {
|
||
Count int
|
||
Offset int
|
||
Text string
|
||
}
|
||
|
||
// OrderByItem ORDER BY 项
|
||
type OrderByItem struct {
|
||
Text string
|
||
Desc bool
|
||
}
|
||
|
||
// Assignment SET 赋值
|
||
type Assignment struct {
|
||
Column string
|
||
Value *Expr
|
||
Text string
|
||
}
|