Files
mayfly-go/server/internal/db/dbm/sqlparser/sqlstmt/common.go
2026-05-08 20:45:13 +08:00

42 lines
693 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}