Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClauseType ¶
type ClauseType int
ClauseType 定义 SQL 子句的数据类型
const ( ClauseInsert ClauseType = iota // insert ClauseReplaceMysql // replace(MySQL) ClauseReplacePostgresql // replace(PostgreSQL) ClauseUpdate // update ClauseDelete // delete ClauseSelect // select ClauseCount // count ClauseValues // values ClauseDistinct // distinct ClauseFrom // from ClauseInnerJoin // inner join ClauseLeftJoin // left join ClauseRightJoin // right join ClauseWhere // where ClauseGroupBy // group by ClauseHaving // having ClauseOrderBy // order by ClauseLimit // limit )
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement 定义 SQL 语句的数据结构
func (*Statement) GenerateSQL ¶
func (own *Statement) GenerateSQL(types ...ClauseType) (string, []any)
GenerateSQL 生成完整的 SQL 语句和参数列表
func (*Statement) WithClause ¶
func (own *Statement) WithClause(typ ClauseType, vars ...any) *Statement
WithClause 添加 SQL 子句
func (*Statement) WithTableName ¶
WithTableName 指定数据表名
Click to show internal directories.
Click to hide internal directories.