Documentation ¶
Index ¶
- Constants
- func ParseSqlResult(input any, e any) error
- type CheckExistExecuteParams
- type CheckHasOnlyOneExecuteParams
- type Conditions
- func (conditions *Conditions) AddCondition(condition string) *Conditions
- func (conditions *Conditions) Equal(columnName string, value any) *Conditions
- func (conditions *Conditions) GreaterThan(columnName string, value any) *Conditions
- func (conditions *Conditions) GreaterThanAndEqual(columnName string, value any) *Conditions
- func (conditions *Conditions) In(columnName string, value any) *Conditions
- func (conditions *Conditions) LessThan(columnName string, value any) *Conditions
- func (conditions *Conditions) LessThanAndEqual(columnName string, value any) *Conditions
- func (conditions *Conditions) Like(columnName string, value string) *Conditions
- func (conditions *Conditions) Not(columnName string, value any) *Conditions
- func (conditions *Conditions) NotIn(columnName string, value any) *Conditions
- type CountExecuteParams
- type DeleteExecuteParams
- type InsertBatchExecuteParams
- type InsertExecuteParams
- type QueryExecuteParams
- type QueryOneExecuteParams
- type Result
- func (result Result) ColumnValueBool(columnName string) bool
- func (result Result) ColumnValueFloat32(columnName string) float32
- func (result Result) ColumnValueFloat64(columnName string) float64
- func (result Result) ColumnValueInt(columnName string) int
- func (result Result) ColumnValueInt16(columnName string) int16
- func (result Result) ColumnValueInt32(columnName string) int32
- func (result Result) ColumnValueInt64(columnName string) int64
- func (result Result) ColumnValueInt8(columnName string) int8
- func (result Result) ColumnValueString(columnName string) string
- func (result Result) ColumnValueStringAsTime(columnName string) time.Time
- func (result Result) ColumnValueUint(columnName string) uint
- func (result Result) ColumnValueUint16(columnName string) uint16
- func (result Result) ColumnValueUint32(columnName string) uint32
- func (result Result) ColumnValueUint64(columnName string) uint64
- func (result Result) ColumnValueUint8(columnName string) uint8
- type TableRow
- type UpdateExecuteParams
Constants ¶
View Source
const CountTpl = `
SELECT
COUNT(*)
FROM
{{ .table_name }}
WHERE
{{ range .conditions }} {{ . }} AND {{ end }} 1 = 1
`
View Source
const DeleteTpl = `
DELETE FROM
{{ .table_name }}
WHERE
{{ range .conditions }} {{ . }} AND {{ end }} 1 = 1
`
View Source
const InsertTpl = `` /* 288-byte string literal not displayed */
View Source
const QueryTpl = `` /* 320-byte string literal not displayed */
View Source
const UpdateTpl = `` /* 127-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ParseSqlResult ¶
Types ¶
type CheckExistExecuteParams ¶
type CheckExistExecuteParams struct { TableName string *Conditions }
type CheckHasOnlyOneExecuteParams ¶
type CheckHasOnlyOneExecuteParams struct { TableName string *Conditions }
type Conditions ¶
type Conditions struct { Conditions []string // contains filtered or unexported fields }
func NewConditions ¶
func NewConditions() *Conditions
func (*Conditions) AddCondition ¶
func (conditions *Conditions) AddCondition(condition string) *Conditions
func (*Conditions) Equal ¶
func (conditions *Conditions) Equal(columnName string, value any) *Conditions
func (*Conditions) GreaterThan ¶
func (conditions *Conditions) GreaterThan(columnName string, value any) *Conditions
func (*Conditions) GreaterThanAndEqual ¶
func (conditions *Conditions) GreaterThanAndEqual(columnName string, value any) *Conditions
func (*Conditions) In ¶
func (conditions *Conditions) In(columnName string, value any) *Conditions
func (*Conditions) LessThan ¶
func (conditions *Conditions) LessThan(columnName string, value any) *Conditions
func (*Conditions) LessThanAndEqual ¶
func (conditions *Conditions) LessThanAndEqual(columnName string, value any) *Conditions
func (*Conditions) Like ¶
func (conditions *Conditions) Like(columnName string, value string) *Conditions
func (*Conditions) Not ¶
func (conditions *Conditions) Not(columnName string, value any) *Conditions
func (*Conditions) NotIn ¶
func (conditions *Conditions) NotIn(columnName string, value any) *Conditions
type CountExecuteParams ¶
type CountExecuteParams struct { TableName string *Conditions }
type DeleteExecuteParams ¶
type DeleteExecuteParams struct { TableName string *Conditions }
type InsertExecuteParams ¶
type QueryExecuteParams ¶
type QueryOneExecuteParams ¶
type QueryOneExecuteParams struct { TableName string SelectClauses []string *Conditions }
type Result ¶
func (Result) ColumnValueBool ¶
func (Result) ColumnValueFloat32 ¶
func (Result) ColumnValueFloat64 ¶
func (Result) ColumnValueInt ¶
func (Result) ColumnValueInt16 ¶
func (Result) ColumnValueInt32 ¶
func (Result) ColumnValueInt64 ¶
func (Result) ColumnValueInt8 ¶
func (Result) ColumnValueString ¶
func (Result) ColumnValueStringAsTime ¶
func (Result) ColumnValueUint ¶
func (Result) ColumnValueUint16 ¶
func (Result) ColumnValueUint32 ¶
func (Result) ColumnValueUint64 ¶
func (Result) ColumnValueUint8 ¶
type TableRow ¶
type TableRow struct {
// contains filtered or unexported fields
}
func NewTableRow ¶
func NewTableRow() *TableRow
type UpdateExecuteParams ¶
type UpdateExecuteParams struct { TableName string *TableRow *Conditions }
Click to show internal directories.
Click to hide internal directories.