Documentation ¶
Index ¶
- Constants
- func EscapeName(name string) string
- func EscapeValue(val interface{}) string
- func Map(items []string, mapper func(string) string) []string
- func Map0(items []interface{}, mapper func(interface{}) string) []string
- type ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) AutoIncrement() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) BigInt(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Blob() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Char(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Column(name string) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Date() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) DateTime() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Decimal(size int, d int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Default(value interface{}) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Default0() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) DefaultEmptyString() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) DefaultNow() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) DefaultNull() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Double(size int, d int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *ColumnTypeBuilder) Float(size int, d int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) ForeignKey(refTableName string, refColumnName string) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) ForeignKeyNamed(fkName string, refTableName string, refColumnName string) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) GetSQL() string
- func (slf *ColumnTypeBuilder) Int(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) LongBlob() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) LongText() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) MediumBlob() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) MediumInt(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) MediumText() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) NotNull() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) PrimaryKey() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Set() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) SmallInt(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Text() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Time() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Timestamp() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) TinyInt(size int) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) TinyText() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) Unique() *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) UniqueNamed(name string) *ColumnTypeBuilder
- func (slf *ColumnTypeBuilder) VarChar(size int) *ColumnTypeBuilder
- type Condition
- func Equal(column string) *Condition
- func EqualTo(column string, value interface{}) *Condition
- func GreaterEqualThen(column string) *Condition
- func GreaterEqualThenTo(column string, value interface{}) *Condition
- func GreaterThen(column string) *Condition
- func GreaterThenTo(column string, value interface{}) *Condition
- func LessEqualThen(column string) *Condition
- func LessEqualThenTo(column string, value interface{}) *Condition
- func LessThen(column string) *Condition
- func LessThenTo(column string, value interface{}) *Condition
- func NotEqual(column string) *Condition
- func NotEqualTo(column string, value interface{}) *Condition
- func (slf *Condition) And() *Condition
- func (slf *Condition) Between(column string, start interface{}, end interface{}) *Condition
- func (slf *Condition) Compile() string
- func (slf *Condition) Equal(column string) *Condition
- func (slf *Condition) EqualTo(column string, value interface{}) *Condition
- func (slf *Condition) GreaterEqualThen(column string) *Condition
- func (slf *Condition) GreaterEqualThenTo(column string, value interface{}) *Condition
- func (slf *Condition) GreaterThen(column string) *Condition
- func (slf *Condition) GreaterThenTo(column string, value interface{}) *Condition
- func (slf *Condition) In(column string, items ...interface{}) *Condition
- func (slf *Condition) LessEqualThen(column string) *Condition
- func (slf *Condition) LessEqualThenTo(column string, value interface{}) *Condition
- func (slf *Condition) LessThen(column string) *Condition
- func (slf *Condition) LessThenTo(column string, value interface{}) *Condition
- func (slf *Condition) Like(column string, pattern string) *Condition
- func (slf *Condition) NotEqual(column string) *Condition
- func (slf *Condition) NotEqualTo(column string, value interface{}) *Condition
- func (slf *Condition) Or() *Condition
- type ConditionGroup
- type CreateIndexBuilder
- func (slf *CreateIndexBuilder) Column(name string, desc bool) *CreateIndexBuilder
- func (slf *CreateIndexBuilder) Columns(columns ...string) *CreateIndexBuilder
- func (slf *CreateIndexBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *CreateIndexBuilder) GetSQL() string
- func (slf *CreateIndexBuilder) OnTable(table string) *CreateIndexBuilder
- func (slf *CreateIndexBuilder) Unique() *CreateIndexBuilder
- type DeleteBuilder
- func (slf *DeleteBuilder) Compile() string
- func (slf *DeleteBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *DeleteBuilder) GetSQL() string
- func (slf *DeleteBuilder) Table(table string) *DeleteBuilder
- func (slf *DeleteBuilder) Where(conditions SQLStatement) *WhereBuilder
- func (slf *DeleteBuilder) YesYesYesForceDelete() *DeleteBuilder
- type DropIndexBuilder
- type Execute
- type Executor
- type GroupByBuilder
- type InsertBuilder
- func (slf *InsertBuilder) Columns(columns ...string) *InsertBuilder
- func (slf *InsertBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *InsertBuilder) GetSQL() string
- func (slf *InsertBuilder) Table(table string) *InsertBuilder
- func (slf *InsertBuilder) Values(values ...interface{}) *InsertBuilder
- type LimitBuilder
- func (slf *LimitBuilder) Compile() string
- func (slf *LimitBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *LimitBuilder) GetSQL() string
- func (slf *LimitBuilder) GroupBy(columns ...string) *GroupByBuilder
- func (slf *LimitBuilder) Offset(offset int) *LimitBuilder
- func (slf *LimitBuilder) OrderBy(columns ...string) *OrderByBuilder
- type OrderByBuilder
- func (slf *OrderByBuilder) ASC() *OrderByBuilder
- func (slf *OrderByBuilder) Column(column string) *OrderByBuilder
- func (slf *OrderByBuilder) Compile() string
- func (slf *OrderByBuilder) DESC() *OrderByBuilder
- func (slf *OrderByBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *OrderByBuilder) GetSQL() string
- func (slf *OrderByBuilder) GroupBy(columns ...string) *GroupByBuilder
- func (slf *OrderByBuilder) Limit(limit int) *LimitBuilder
- type SQLGenerator
- type SQLPrepare
- type SQLStatement
- type SelectBuilder
- func (slf *SelectBuilder) Compile() string
- func (slf *SelectBuilder) Distinct() *SelectBuilder
- func (slf *SelectBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *SelectBuilder) From(table string) *SelectBuilder
- func (slf *SelectBuilder) FromSelect(innerSelect SQLStatement) *SelectBuilder
- func (slf *SelectBuilder) GetSQL() string
- func (slf *SelectBuilder) GroupBy(columns ...string) *GroupByBuilder
- func (slf *SelectBuilder) Limit(limit int) *LimitBuilder
- func (slf *SelectBuilder) OrderBy(columns ...string) *OrderByBuilder
- func (slf *SelectBuilder) Where(conditions SQLStatement) *WhereBuilder
- type TableBuilder
- func (slf *TableBuilder) Column(name string) *ColumnTypeBuilder
- func (slf *TableBuilder) GetSQL() string
- func (slf *TableBuilder) IfNotExists(ifIs bool) *TableBuilder
- func (slf *TableBuilder) SetAutoIncrement(increment int) *TableBuilder
- func (slf *TableBuilder) SetCharset(charset string) *TableBuilder
- type UpdateBuilder
- func (slf *UpdateBuilder) ColumnAndValue(column string, value interface{}) *UpdateBuilder
- func (slf *UpdateBuilder) Columns(columns ...string) *UpdateBuilder
- func (slf *UpdateBuilder) Compile() string
- func (slf *UpdateBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *UpdateBuilder) GetSQL() string
- func (slf *UpdateBuilder) Table(table string) *UpdateBuilder
- func (slf *UpdateBuilder) Where(conditions SQLStatement) *WhereBuilder
- func (slf *UpdateBuilder) YesYesYesForceUpdate() *UpdateBuilder
- type WhereBuilder
- func (slf *WhereBuilder) Compile() string
- func (slf *WhereBuilder) Execute(prepare SQLPrepare) *Executor
- func (slf *WhereBuilder) GetSQL() string
- func (slf *WhereBuilder) GroupBy(columns ...string) *GroupByBuilder
- func (slf *WhereBuilder) Limit(limit int) *LimitBuilder
- func (slf *WhereBuilder) OrderBy(columns ...string) *OrderByBuilder
Constants ¶
const SQLComma = ", "
const SQLNameEscape = "`"
const SQLPlaceHolder = "?"
const SQLSpace = " "
const SQLStringValueEscape = "'"
Variables ¶
This section is empty.
Functions ¶
func EscapeName ¶
func EscapeValue ¶
func EscapeValue(val interface{}) string
Types ¶
type ColumnTypeBuilder ¶
type ColumnTypeBuilder struct {
// contains filtered or unexported fields
}
func (*ColumnTypeBuilder) AutoIncrement ¶
func (slf *ColumnTypeBuilder) AutoIncrement() *ColumnTypeBuilder
func (*ColumnTypeBuilder) BigInt ¶
func (slf *ColumnTypeBuilder) BigInt(size int) *ColumnTypeBuilder
-9223372036854775808 到 9223372036854775807 常规。0 到 18446744073709551615 无符号*。在括号中规定最大位数。
func (*ColumnTypeBuilder) Blob ¶
func (slf *ColumnTypeBuilder) Blob() *ColumnTypeBuilder
用于 BLOBs (Binary Large OBjects)。存放最多 65,535 字节的数据。
func (*ColumnTypeBuilder) Char ¶
func (slf *ColumnTypeBuilder) Char(size int) *ColumnTypeBuilder
保存固定长度的字符串(可包含字母、数字以及特殊字符)。在括号中指定字符串的长度。最多 255 个字符。
func (*ColumnTypeBuilder) Column ¶
func (slf *ColumnTypeBuilder) Column(name string) *ColumnTypeBuilder
func (*ColumnTypeBuilder) Date ¶
func (slf *ColumnTypeBuilder) Date() *ColumnTypeBuilder
日期。格式:YYYY-MM-DD 支持的范围是从 '1000-01-01' 到 '9999-12-31'
func (*ColumnTypeBuilder) DateTime ¶
func (slf *ColumnTypeBuilder) DateTime() *ColumnTypeBuilder
日期和时间的组合。格式:YYYY-MM-DD HH:MM:SS 支持的范围是从 '1000-01-01 00:00:00' 到 '9999-12-31 23:59:59'
func (*ColumnTypeBuilder) Decimal ¶
func (slf *ColumnTypeBuilder) Decimal(size int, d int) *ColumnTypeBuilder
作为字符串存储的 DOUBLE 类型,允许固定的小数点。
func (*ColumnTypeBuilder) Default ¶
func (slf *ColumnTypeBuilder) Default(value interface{}) *ColumnTypeBuilder
func (*ColumnTypeBuilder) Default0 ¶
func (slf *ColumnTypeBuilder) Default0() *ColumnTypeBuilder
func (*ColumnTypeBuilder) DefaultEmptyString ¶
func (slf *ColumnTypeBuilder) DefaultEmptyString() *ColumnTypeBuilder
func (*ColumnTypeBuilder) DefaultNow ¶
func (slf *ColumnTypeBuilder) DefaultNow() *ColumnTypeBuilder
func (*ColumnTypeBuilder) DefaultNull ¶
func (slf *ColumnTypeBuilder) DefaultNull() *ColumnTypeBuilder
func (*ColumnTypeBuilder) Double ¶
func (slf *ColumnTypeBuilder) Double(size int, d int) *ColumnTypeBuilder
带有浮动小数点的大数字。在括号中规定最大位数。在 d 参数中规定小数点右侧的最大位数。
func (*ColumnTypeBuilder) Execute ¶
func (slf *ColumnTypeBuilder) Execute(prepare SQLPrepare) *Executor
func (*ColumnTypeBuilder) Float ¶
func (slf *ColumnTypeBuilder) Float(size int, d int) *ColumnTypeBuilder
带有浮动小数点的小数字。在括号中规定最大位数。在 d 参数中规定小数点右侧的最大位数。
func (*ColumnTypeBuilder) ForeignKey ¶
func (slf *ColumnTypeBuilder) ForeignKey(refTableName string, refColumnName string) *ColumnTypeBuilder
func (*ColumnTypeBuilder) ForeignKeyNamed ¶
func (slf *ColumnTypeBuilder) ForeignKeyNamed(fkName string, refTableName string, refColumnName string) *ColumnTypeBuilder
func (*ColumnTypeBuilder) GetSQL ¶
func (slf *ColumnTypeBuilder) GetSQL() string
func (*ColumnTypeBuilder) Int ¶
func (slf *ColumnTypeBuilder) Int(size int) *ColumnTypeBuilder
-2147483648 到 2147483647 常规。0 到 4294967295 无符号*。在括号中规定最大位数。
func (*ColumnTypeBuilder) LongBlob ¶
func (slf *ColumnTypeBuilder) LongBlob() *ColumnTypeBuilder
用于 BLOBs (Binary Large OBjects)。存放最多 4,294,967,295 字节的数据。
func (*ColumnTypeBuilder) LongText ¶
func (slf *ColumnTypeBuilder) LongText() *ColumnTypeBuilder
存放最大长度为 4,294,967,295 个字符的字符串。
func (*ColumnTypeBuilder) MediumBlob ¶
func (slf *ColumnTypeBuilder) MediumBlob() *ColumnTypeBuilder
用于 BLOBs (Binary Large OBjects)。存放最多 16,777,215 字节的数据。
func (*ColumnTypeBuilder) MediumInt ¶
func (slf *ColumnTypeBuilder) MediumInt(size int) *ColumnTypeBuilder
-8388608 到 8388607 普通。0 to 16777215 无符号*。在括号中规定最大位数。
func (*ColumnTypeBuilder) MediumText ¶
func (slf *ColumnTypeBuilder) MediumText() *ColumnTypeBuilder
存放最大长度为 16,777,215 个字符的字符串。
func (*ColumnTypeBuilder) NotNull ¶
func (slf *ColumnTypeBuilder) NotNull() *ColumnTypeBuilder
func (*ColumnTypeBuilder) PrimaryKey ¶
func (slf *ColumnTypeBuilder) PrimaryKey() *ColumnTypeBuilder
func (*ColumnTypeBuilder) Set ¶
func (slf *ColumnTypeBuilder) Set() *ColumnTypeBuilder
SET 最多只能包含 64 个列表项,不过 SET 可存储一个以上的值。
func (*ColumnTypeBuilder) SmallInt ¶
func (slf *ColumnTypeBuilder) SmallInt(size int) *ColumnTypeBuilder
-32768 到 32767 常规。0 到 65535 无符号*。在括号中规定最大位数。
func (*ColumnTypeBuilder) Text ¶
func (slf *ColumnTypeBuilder) Text() *ColumnTypeBuilder
存放最大长度为 65,535 个字符的字符串。
func (*ColumnTypeBuilder) Time ¶
func (slf *ColumnTypeBuilder) Time() *ColumnTypeBuilder
时间。格式:HH:MM:SS 注释:支持的范围是从 '-838:59:59' 到 '838:59:59'
func (*ColumnTypeBuilder) Timestamp ¶
func (slf *ColumnTypeBuilder) Timestamp() *ColumnTypeBuilder
*时间戳。TIMESTAMP 值使用 Unix 纪元('1970-01-01 00:00:00' UTC) 至今的描述来存储。格式:YYYY-MM-DD HH:MM:SS 支持的范围是从 '1970-01-01 00:00:01' UTC 到 '2038-01-09 03:14:07' UTC
func (*ColumnTypeBuilder) TinyInt ¶
func (slf *ColumnTypeBuilder) TinyInt(size int) *ColumnTypeBuilder
-128 到 127 常规。0 到 255 无符号*。在括号中规定最大位数。
func (*ColumnTypeBuilder) TinyText ¶
func (slf *ColumnTypeBuilder) TinyText() *ColumnTypeBuilder
存放最大长度为 255 个字符的字符串。
func (*ColumnTypeBuilder) Unique ¶
func (slf *ColumnTypeBuilder) Unique() *ColumnTypeBuilder
func (*ColumnTypeBuilder) UniqueNamed ¶
func (slf *ColumnTypeBuilder) UniqueNamed(name string) *ColumnTypeBuilder
func (*ColumnTypeBuilder) VarChar ¶
func (slf *ColumnTypeBuilder) VarChar(size int) *ColumnTypeBuilder
保存可变长度的字符串(可包含字母、数字以及特殊字符)。在括号中指定字符串的最大长度。最多 255 个字符。
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
func GreaterEqualThen ¶
func GreaterEqualThenTo ¶
func GreaterThen ¶
func GreaterThenTo ¶
func LessEqualThen ¶
func LessEqualThenTo ¶
func LessThenTo ¶
func NotEqualTo ¶
func (*Condition) GreaterEqualThen ¶
func (*Condition) GreaterEqualThenTo ¶
func (*Condition) GreaterThen ¶
func (*Condition) GreaterThenTo ¶
func (*Condition) LessEqualThen ¶
func (*Condition) LessEqualThenTo ¶
func (*Condition) LessThenTo ¶
func (*Condition) NotEqualTo ¶
type ConditionGroup ¶
type ConditionGroup struct {
// contains filtered or unexported fields
}
func Group ¶
func Group(conditions SQLStatement) *ConditionGroup
func (*ConditionGroup) And ¶
func (slf *ConditionGroup) And() *ConditionGroup
func (*ConditionGroup) Compile ¶
func (slf *ConditionGroup) Compile() string
func (*ConditionGroup) Group ¶
func (slf *ConditionGroup) Group(conditions SQLStatement) *ConditionGroup
func (*ConditionGroup) Or ¶
func (slf *ConditionGroup) Or() *ConditionGroup
type CreateIndexBuilder ¶
type CreateIndexBuilder struct {
// contains filtered or unexported fields
}
func CreateIndex ¶
func CreateIndex(indexName string) *CreateIndexBuilder
func (*CreateIndexBuilder) Column ¶
func (slf *CreateIndexBuilder) Column(name string, desc bool) *CreateIndexBuilder
func (*CreateIndexBuilder) Columns ¶
func (slf *CreateIndexBuilder) Columns(columns ...string) *CreateIndexBuilder
func (*CreateIndexBuilder) Execute ¶
func (slf *CreateIndexBuilder) Execute(prepare SQLPrepare) *Executor
func (*CreateIndexBuilder) GetSQL ¶
func (slf *CreateIndexBuilder) GetSQL() string
func (*CreateIndexBuilder) OnTable ¶
func (slf *CreateIndexBuilder) OnTable(table string) *CreateIndexBuilder
func (*CreateIndexBuilder) Unique ¶
func (slf *CreateIndexBuilder) Unique() *CreateIndexBuilder
type DeleteBuilder ¶
type DeleteBuilder struct {
// contains filtered or unexported fields
}
func Delete ¶
func Delete(table string) *DeleteBuilder
func (*DeleteBuilder) Compile ¶
func (slf *DeleteBuilder) Compile() string
func (*DeleteBuilder) Execute ¶
func (slf *DeleteBuilder) Execute(prepare SQLPrepare) *Executor
func (*DeleteBuilder) GetSQL ¶
func (slf *DeleteBuilder) GetSQL() string
func (*DeleteBuilder) Table ¶
func (slf *DeleteBuilder) Table(table string) *DeleteBuilder
func (*DeleteBuilder) Where ¶
func (slf *DeleteBuilder) Where(conditions SQLStatement) *WhereBuilder
func (*DeleteBuilder) YesYesYesForceDelete ¶
func (slf *DeleteBuilder) YesYesYesForceDelete() *DeleteBuilder
type DropIndexBuilder ¶
type DropIndexBuilder struct {
// contains filtered or unexported fields
}
func DropIndex ¶
func DropIndex(indexName string) *DropIndexBuilder
func (*DropIndexBuilder) Execute ¶
func (slf *DropIndexBuilder) Execute(prepare SQLPrepare) *Executor
func (*DropIndexBuilder) GetSQL ¶
func (slf *DropIndexBuilder) GetSQL() string
func (*DropIndexBuilder) OnTable ¶
func (slf *DropIndexBuilder) OnTable(table string) *DropIndexBuilder
type Executor ¶
type Executor struct { DBPrepare SQLPrepare // contains filtered or unexported fields }
type GroupByBuilder ¶
type GroupByBuilder struct {
// contains filtered or unexported fields
}
func (*GroupByBuilder) Compile ¶
func (slf *GroupByBuilder) Compile() string
func (*GroupByBuilder) Execute ¶
func (slf *GroupByBuilder) Execute(prepare SQLPrepare) *Executor
func (*GroupByBuilder) GetSQL ¶
func (slf *GroupByBuilder) GetSQL() string
func (*GroupByBuilder) Limit ¶
func (slf *GroupByBuilder) Limit(limit int) *LimitBuilder
func (*GroupByBuilder) OrderBy ¶
func (slf *GroupByBuilder) OrderBy(columns ...string) *OrderByBuilder
type InsertBuilder ¶
type InsertBuilder struct {
// contains filtered or unexported fields
}
func Insert ¶
func Insert(table string) *InsertBuilder
func (*InsertBuilder) Columns ¶
func (slf *InsertBuilder) Columns(columns ...string) *InsertBuilder
func (*InsertBuilder) Execute ¶
func (slf *InsertBuilder) Execute(prepare SQLPrepare) *Executor
func (*InsertBuilder) GetSQL ¶
func (slf *InsertBuilder) GetSQL() string
func (*InsertBuilder) Table ¶
func (slf *InsertBuilder) Table(table string) *InsertBuilder
func (*InsertBuilder) Values ¶
func (slf *InsertBuilder) Values(values ...interface{}) *InsertBuilder
type LimitBuilder ¶
type LimitBuilder struct {
// contains filtered or unexported fields
}
func (*LimitBuilder) Compile ¶
func (slf *LimitBuilder) Compile() string
func (*LimitBuilder) Execute ¶
func (slf *LimitBuilder) Execute(prepare SQLPrepare) *Executor
func (*LimitBuilder) GetSQL ¶
func (slf *LimitBuilder) GetSQL() string
func (*LimitBuilder) GroupBy ¶
func (slf *LimitBuilder) GroupBy(columns ...string) *GroupByBuilder
func (*LimitBuilder) Offset ¶
func (slf *LimitBuilder) Offset(offset int) *LimitBuilder
func (*LimitBuilder) OrderBy ¶
func (slf *LimitBuilder) OrderBy(columns ...string) *OrderByBuilder
type OrderByBuilder ¶
type OrderByBuilder struct {
// contains filtered or unexported fields
}
func (*OrderByBuilder) ASC ¶
func (slf *OrderByBuilder) ASC() *OrderByBuilder
func (*OrderByBuilder) Column ¶
func (slf *OrderByBuilder) Column(column string) *OrderByBuilder
func (*OrderByBuilder) Compile ¶
func (slf *OrderByBuilder) Compile() string
func (*OrderByBuilder) DESC ¶
func (slf *OrderByBuilder) DESC() *OrderByBuilder
func (*OrderByBuilder) Execute ¶
func (slf *OrderByBuilder) Execute(prepare SQLPrepare) *Executor
func (*OrderByBuilder) GetSQL ¶
func (slf *OrderByBuilder) GetSQL() string
func (*OrderByBuilder) GroupBy ¶
func (slf *OrderByBuilder) GroupBy(columns ...string) *GroupByBuilder
func (*OrderByBuilder) Limit ¶
func (slf *OrderByBuilder) Limit(limit int) *LimitBuilder
type SQLGenerator ¶
type SQLGenerator interface {
GetSQL() string
}
type SQLStatement ¶
type SQLStatement interface {
Compile() string
}
type SelectBuilder ¶
type SelectBuilder struct {
// contains filtered or unexported fields
}
func Select ¶
func Select(columns ...string) *SelectBuilder
func (*SelectBuilder) Compile ¶
func (slf *SelectBuilder) Compile() string
func (*SelectBuilder) Distinct ¶
func (slf *SelectBuilder) Distinct() *SelectBuilder
func (*SelectBuilder) Execute ¶
func (slf *SelectBuilder) Execute(prepare SQLPrepare) *Executor
func (*SelectBuilder) From ¶
func (slf *SelectBuilder) From(table string) *SelectBuilder
func (*SelectBuilder) FromSelect ¶
func (slf *SelectBuilder) FromSelect(innerSelect SQLStatement) *SelectBuilder
func (*SelectBuilder) GetSQL ¶
func (slf *SelectBuilder) GetSQL() string
func (*SelectBuilder) GroupBy ¶
func (slf *SelectBuilder) GroupBy(columns ...string) *GroupByBuilder
func (*SelectBuilder) Limit ¶
func (slf *SelectBuilder) Limit(limit int) *LimitBuilder
func (*SelectBuilder) OrderBy ¶
func (slf *SelectBuilder) OrderBy(columns ...string) *OrderByBuilder
func (*SelectBuilder) Where ¶
func (slf *SelectBuilder) Where(conditions SQLStatement) *WhereBuilder
type TableBuilder ¶
type TableBuilder struct {
// contains filtered or unexported fields
}
func CreateTable ¶
func CreateTable(table string) *TableBuilder
func (*TableBuilder) Column ¶
func (slf *TableBuilder) Column(name string) *ColumnTypeBuilder
func (*TableBuilder) GetSQL ¶
func (slf *TableBuilder) GetSQL() string
func (*TableBuilder) IfNotExists ¶
func (slf *TableBuilder) IfNotExists(ifIs bool) *TableBuilder
func (*TableBuilder) SetAutoIncrement ¶
func (slf *TableBuilder) SetAutoIncrement(increment int) *TableBuilder
func (*TableBuilder) SetCharset ¶
func (slf *TableBuilder) SetCharset(charset string) *TableBuilder
type UpdateBuilder ¶
type UpdateBuilder struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(table string) *UpdateBuilder
func (*UpdateBuilder) ColumnAndValue ¶
func (slf *UpdateBuilder) ColumnAndValue(column string, value interface{}) *UpdateBuilder
func (*UpdateBuilder) Columns ¶
func (slf *UpdateBuilder) Columns(columns ...string) *UpdateBuilder
func (*UpdateBuilder) Compile ¶
func (slf *UpdateBuilder) Compile() string
func (*UpdateBuilder) Execute ¶
func (slf *UpdateBuilder) Execute(prepare SQLPrepare) *Executor
func (*UpdateBuilder) GetSQL ¶
func (slf *UpdateBuilder) GetSQL() string
func (*UpdateBuilder) Table ¶
func (slf *UpdateBuilder) Table(table string) *UpdateBuilder
func (*UpdateBuilder) Where ¶
func (slf *UpdateBuilder) Where(conditions SQLStatement) *WhereBuilder
func (*UpdateBuilder) YesYesYesForceUpdate ¶
func (slf *UpdateBuilder) YesYesYesForceUpdate() *UpdateBuilder
type WhereBuilder ¶
type WhereBuilder struct {
// contains filtered or unexported fields
}
func (*WhereBuilder) Compile ¶
func (slf *WhereBuilder) Compile() string
func (*WhereBuilder) Execute ¶
func (slf *WhereBuilder) Execute(prepare SQLPrepare) *Executor
func (*WhereBuilder) GetSQL ¶
func (slf *WhereBuilder) GetSQL() string
func (*WhereBuilder) GroupBy ¶
func (slf *WhereBuilder) GroupBy(columns ...string) *GroupByBuilder
func (*WhereBuilder) Limit ¶
func (slf *WhereBuilder) Limit(limit int) *LimitBuilder
func (*WhereBuilder) OrderBy ¶
func (slf *WhereBuilder) OrderBy(columns ...string) *OrderByBuilder