Documentation ¶
Index ¶
Constants ¶
View Source
const ( ORDER_ASC string = "ASC" ORDER_DESC string = "DESC" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClauseType ¶
type ClauseType int
ClauseType defines the dataype of SQL clause
const ( CLAUSE_INSERT ClauseType = iota CLAUSE_VALUES CLAUSE_SELECT CLAUSE_DISTINCT CLAUSE_FROM CLAUSE_UPDATE CLAUSE_DELETE CLAUSE_COUNT CLAUSE_WHERE CLAUSE_GROUPBY CLAUSE_HAVING CLAUSE_ORDERBY CLAUSE_LIMIT )
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement defines the structure of SQL statement.
func NewStatement ¶
func (*Statement) Build ¶
func (own *Statement) Build(types ...ClauseType) (string, []any)
Build generates the final SQL and SQLVars by the orders of SQL clauses.
func (*Statement) WithClause ¶
func (own *Statement) WithClause(typ ClauseType, vars ...any) *Statement
WithClause adds the type and variables of a specific clause.
func (*Statement) WithTableName ¶
Click to show internal directories.
Click to hide internal directories.