Documentation ¶
Index ¶
- Constants
- func ConvertParams(v interface{}, escaper string) string
- func DeleteSQL(tableName, column string) string
- func ExistsSQL(tableName, column string, withDeletedAt bool) string
- func ExistsSQLByFilterExprs(tableName string, filters FilterExprs) string
- func ExistsSQLByQuerySQL(qsql string) string
- func TableName(name string, id uint64) string
- type Config
- type FilterExpr
- type FilterExprs
- type Operation
Constants ¶
View Source
const ( TmFmtWithMS = "2006-01-02 15:04:05.999" NullStr = "NULL" )
View Source
const ( ColumnDeletedAt = "deleted_at" ColumnId = "id" ColumnName = "name" )
View Source
const ( ExprEqual = " = ?" ExprNotEqual = " != ?" ExprGreater = " > ?" )
View Source
const ( Mysql = "mysql" Postgres = "postgres" Sqlite = "sqlite" )
View Source
const ( Insert = "INSERT" Select = "SELECT" Update = "UPDATE" Delete = "DELETE" LeftJoin = "LEFT JOIN" RightJoin = "RIGHT JOIN" InnerJoin = "INNER JOIN" Limit = `LIMIT %d` Offset = `OFFSET %d` Limit1 = `LIMIT 1` )
View Source
const ( NotDeleted = ColumnDeletedAt + " IS " + NullStr WithNotDeleted = ` AND ` + NotDeleted )
View Source
const ( IdEqual = ColumnId + ExprEqual NameEqual = ColumnName + ExprEqual )
Variables ¶
This section is empty.
Functions ¶
func ConvertParams ¶
func ExistsSQLByFilterExprs ¶ added in v1.6.13
func ExistsSQLByFilterExprs(tableName string, filters FilterExprs) string
func ExistsSQLByQuerySQL ¶ added in v1.6.13
Types ¶
type FilterExpr ¶ added in v1.6.13
type FilterExprs ¶ added in v1.6.13
type FilterExprs []FilterExpr
func (FilterExprs) Build ¶ added in v1.6.13
func (f FilterExprs) Build() string
func (FilterExprs) BuildSQL ¶ added in v1.6.13
func (f FilterExprs) BuildSQL() (string, []interface{})
Click to show internal directories.
Click to hide internal directories.