Documentation ¶
Index ¶
- func BoolSliceArgs(src ...bool) []interface{}
- func CompliantName(in string) string
- func ExpandAsColumns(cols ...string) []string
- func Int16SliceArgs(src ...int16) []interface{}
- func Int32SliceArgs(src ...int32) []interface{}
- func Int8SliceArgs(src ...int8) []interface{}
- func IntSliceArgs(src ...int) []interface{}
- func JoinColumns(cols ...string) string
- func JoinColumnsWithAs(cols ...string) string
- func JoinTableColumns(table string, cols ...string) string
- func JoinTableColumnsValues(cmp string, table string, cols ...string) string
- func JoinTableColumnsWithAs(table string, cols ...string) string
- func JoinTableValues(cols ...string) string
- func Pagination(limit, offset int) string
- func Placeholders(n int) string
- func StringSliceArgs(src ...string) []interface{}
- func TableColumns(table string, cols ...string) []string
- func TableColumnsValues(cmp string, table string, cols ...string) []string
- func TableValues(cols ...string) []string
- func TimeSliceArgs(src ...time.Time) []interface{}
- func Uint16SliceArgs(src ...uint16) []interface{}
- func Uint32SliceArgs(src ...uint32) []interface{}
- func Uint8SliceArgs(src ...uint8) []interface{}
- func UintSliceArgs(src ...uint) []interface{}
- type NullDuration
- type NullJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolSliceArgs ¶
func BoolSliceArgs(src ...bool) []interface{}
func CompliantName ¶
CompliantName returns a compliant id name that can be used for a bind or as var. replace special runes with '_' a.b -> a_b
func ExpandAsColumns ¶
ExpandAsColumns expand columns with alias AS query := ExpandAsColumns("table.foo", "bar") // []string{"table.foo AS table_foo", "bar AS bar"}
func Int16SliceArgs ¶
func Int16SliceArgs(src ...int16) []interface{}
func Int32SliceArgs ¶
func Int32SliceArgs(src ...int32) []interface{}
func Int8SliceArgs ¶
func Int8SliceArgs(src ...int8) []interface{}
func IntSliceArgs ¶
func IntSliceArgs(src ...int) []interface{}
func JoinColumns ¶
JoinColumns concatenates the elements of cols to column1, column2, ... query := JoinColumns("foo", "bar") // "foo,bar"
func JoinColumnsWithAs ¶
JoinColumnsWithAs concatenates the elements of cols to column1, column2, ... query := JoinColumnsWithAs("foo", "bar") // "foo AS foo,bar AS bar"
func JoinTableColumns ¶
JoinTableColumns concatenates the elements of cols to column1, column2, ... query := JoinTableColumns("table", "foo", "bar") // "table.foo, table.bar"
func JoinTableColumnsValues ¶
JoinTableColumnsValues concatenates the elements of values to table.value1=:value1, table.value2=:value2 ... query := JoinTableColumnsValues("table", "foo", "bar") // "table.foo=?, table.bar=?"
func JoinTableColumnsWithAs ¶
JoinTableColumnsWithAs concatenates the elements of cols to column1, column2, ... query := JoinTableColumnsWithAs("table", "foo", "bar") // "table.foo AS table.foo, table.bar AS table.bar"
func JoinTableValues ¶
JoinTableValues concatenates the elements of values to :value1, :value2, ... query := JoinTableValues("foo", "bar") // "?,?" query := JoinTableValues() // ""
func Pagination ¶
Pagination returns the "LIMIT %d, OFFSET %d" query := Pagination(0, 0) // "LIMIT 0, OFFSET 0"
func Placeholders ¶
Placeholders behaves like strings.Join([]string{"?",...,"?"}, ",")
func StringSliceArgs ¶
func StringSliceArgs(src ...string) []interface{}
func TableColumns ¶
TableColumns returns the []string{table.value1, table.value2 ...} query := Columns("table", "foo", "bar") // []string{"table.foo", "table.bar"}
func TableColumnsValues ¶
TableColumnsValues returns the []string{table.value1=:value1, table.value2=:value2 ...} query := ColumnsValues("table", "foo", "bar") // []string{"table.foo=?", "table.bar=?"}
func TableValues ¶
TableValues returns the []string{:value1, :value2 ...} query := TableValues("foo", "bar") // []string{"?", "?"}
func TimeSliceArgs ¶
func Uint16SliceArgs ¶
func Uint16SliceArgs(src ...uint16) []interface{}
func Uint32SliceArgs ¶
func Uint32SliceArgs(src ...uint32) []interface{}
func Uint8SliceArgs ¶
func Uint8SliceArgs(src ...uint8) []interface{}
func UintSliceArgs ¶
func UintSliceArgs(src ...uint) []interface{}
Types ¶
type NullDuration ¶
NullDuration represents an interface that may be null. NullDuration implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString.
func (*NullDuration) Scan ¶
func (nj *NullDuration) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
type NullJson ¶
type NullJson struct { Data interface{} // must be set with a pointer to zero value of expect type Valid bool // Valid is true if Data is not NULL }
NullJson represents an interface that may be null. NullJson implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString. Deprecate, use go-nulljson instead. For more information, see: https://godoc.org/github.com/searKing/golang/tools/go-nulljson