Documentation ¶
Index ¶
- func Deref(t reflect.Type) reflect.Type
- func In(query string, args ...interface{}) (string, []interface{}, error)
- func ScanOne(rows *sql.Rows, v interface{}) error
- func ScanSlice(rows *sql.Rows, v interface{}) error
- func TestRebind(t *testing.T)
- type Adapter
- type BigInt
- type BigIntColumn
- func (c *BigIntColumn) Asc() string
- func (c *BigIntColumn) Between(start int64, end int64) *Clause
- func (c *BigIntColumn) Desc() string
- func (c *BigIntColumn) EQ(v int64) *Clause
- func (c *BigIntColumn) GE(v int64) *Clause
- func (c *BigIntColumn) GT(v int64) *Clause
- func (c *BigIntColumn) In(v []int64) *Clause
- func (c *BigIntColumn) InRange(start int64, end int64) *Clause
- func (c *BigIntColumn) LE(v int64) *Clause
- func (c *BigIntColumn) LT(v int64) *Clause
- func (c *BigIntColumn) NE(v int64) *Clause
- type Boolean
- type BooleanColumn
- type Clause
- type DB
- type DeleteStatemnet
- type Float
- type FloatColumn
- func (c *FloatColumn) Asc() string
- func (c *FloatColumn) Desc() string
- func (c *FloatColumn) EQ(v float64) *Clause
- func (c *FloatColumn) GE(v float64) *Clause
- func (c *FloatColumn) GT(v float64) *Clause
- func (c *FloatColumn) In(v []float64) *Clause
- func (c *FloatColumn) LE(v float64) *Clause
- func (c *FloatColumn) LT(v float64) *Clause
- type Integer
- type IntegerColumn
- func (c *IntegerColumn) Asc() string
- func (c *IntegerColumn) Between(start int32, end int32) *Clause
- func (c *IntegerColumn) Desc() string
- func (c *IntegerColumn) EQ(v int32) *Clause
- func (c *IntegerColumn) GE(v int32) *Clause
- func (c *IntegerColumn) GT(v int32) *Clause
- func (c *IntegerColumn) In(v []int32) *Clause
- func (c *IntegerColumn) InRange(start int32, end int32) *Clause
- func (c *IntegerColumn) LE(v int32) *Clause
- func (c *IntegerColumn) LT(v int32) *Clause
- func (c *IntegerColumn) NE(v int32) *Clause
- type JSON
- type JSONColumn
- type Logger
- type Row
- type Rows
- type SelectStatement
- func (s *SelectStatement) Delete() *DeleteStatemnet
- func (s *SelectStatement) Distinct(distinct ...string) *SelectStatement
- func (s *SelectStatement) From(from string) *SelectStatement
- func (s *SelectStatement) GroupBy(group string) *SelectStatement
- func (s *SelectStatement) Having(having string) *SelectStatement
- func (s *SelectStatement) Join(join ...string) *SelectStatement
- func (s *SelectStatement) Limit(limit int) *SelectStatement
- func (s *SelectStatement) Offset(offset int) *SelectStatement
- func (s *SelectStatement) Order(order ...string) *SelectStatement
- func (s *SelectStatement) Select(selection ...string) *SelectStatement
- func (s *SelectStatement) ToSQL() (string, []interface{})
- func (s *SelectStatement) Update() *UpdateStatement
- func (s *SelectStatement) Where(clauses ...*Clause) *SelectStatement
- type String
- type StringColumn
- func (c *StringColumn) Asc() string
- func (c *StringColumn) Desc() string
- func (c *StringColumn) EQ(v string) *Clause
- func (c *StringColumn) EndsWith(v string) *Clause
- func (c *StringColumn) IEQ(v string) *Clause
- func (c *StringColumn) IEndsWith(v string) *Clause
- func (c *StringColumn) ILike(v string) *Clause
- func (c *StringColumn) IStartsWith(v string) *Clause
- func (c *StringColumn) In(v []string) *Clause
- func (c *StringColumn) Like(v string) *Clause
- func (c *StringColumn) NE(v string) *Clause
- func (c *StringColumn) StartsWith(v string) *Clause
- type Table
- func (t *Table) NewBigIntColumn(name string) *BigIntColumn
- func (t *Table) NewBooleanColumn(name string) *BooleanColumn
- func (t *Table) NewFloatColumn(name string) *FloatColumn
- func (t *Table) NewIntegerColumn(name string) *IntegerColumn
- func (t *Table) NewJSONColumn(name string) *JSONColumn
- func (t *Table) NewStringColumn(name string) *StringColumn
- func (t *Table) NewUUIDColumn(name string) *UUIDColumn
- type UUID
- type UUIDColumn
- type UpdateStatement
- func (s *UpdateStatement) Columns(columns ...string) *UpdateStatement
- func (s *UpdateStatement) Returning(returning string) *UpdateStatement
- func (s *UpdateStatement) Table(table string) *UpdateStatement
- func (s *UpdateStatement) ToSQL() (string, []interface{})
- func (s *UpdateStatement) Values(values ...interface{}) *UpdateStatement
- func (s *UpdateStatement) Where(expr *Clause) *UpdateStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func In ¶
In expands slice values in args, returning the modified query string and a new arg list that can be executed by a database. The `query` should use the `?` bindVar. The return value uses the `?` bindVar.
func TestRebind ¶ added in v0.1.7
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶
func (*Adapter) ExecInternal ¶ added in v0.1.7
type BigInt ¶
func NewNullableBigInt ¶
func (BigInt) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type BigIntColumn ¶
func (*BigIntColumn) Asc ¶
func (c *BigIntColumn) Asc() string
func (*BigIntColumn) Desc ¶
func (c *BigIntColumn) Desc() string
func (*BigIntColumn) EQ ¶
func (c *BigIntColumn) EQ(v int64) *Clause
func (*BigIntColumn) GE ¶
func (c *BigIntColumn) GE(v int64) *Clause
func (*BigIntColumn) GT ¶
func (c *BigIntColumn) GT(v int64) *Clause
func (*BigIntColumn) In ¶
func (c *BigIntColumn) In(v []int64) *Clause
func (*BigIntColumn) LE ¶
func (c *BigIntColumn) LE(v int64) *Clause
func (*BigIntColumn) LT ¶
func (c *BigIntColumn) LT(v int64) *Clause
func (*BigIntColumn) NE ¶
func (c *BigIntColumn) NE(v int64) *Clause
type Boolean ¶
func NewBoolean ¶
func NewNullableBoolean ¶
func (Boolean) MarshalJSON ¶ added in v0.1.5
MarshalJSON implements the json.Marshaler interface.
func (*Boolean) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON implements the json.Unmarshaler interface.
type BooleanColumn ¶
func (*BooleanColumn) Asc ¶ added in v0.1.5
func (b *BooleanColumn) Asc() string
func (*BooleanColumn) Desc ¶ added in v0.1.5
func (b *BooleanColumn) Desc() string
func (*BooleanColumn) EQ ¶
func (c *BooleanColumn) EQ(v bool) *Clause
func (*BooleanColumn) NE ¶
func (c *BooleanColumn) NE(v bool) *Clause
type DeleteStatemnet ¶
type DeleteStatemnet struct {
// contains filtered or unexported fields
}
func NewDelete ¶
func NewDelete() *DeleteStatemnet
func (*DeleteStatemnet) From ¶
func (s *DeleteStatemnet) From(from string) *DeleteStatemnet
func (*DeleteStatemnet) ToSQL ¶
func (s *DeleteStatemnet) ToSQL() (string, []interface{})
func (*DeleteStatemnet) Where ¶
func (s *DeleteStatemnet) Where(expr *Clause) *DeleteStatemnet
type Float ¶
func NewNullableFloat ¶
func (Float) MarshalJSON ¶ added in v0.1.5
MarshalJSON implements the json.Marshaler interface.
func (*Float) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON implements the json.Unmarshaler interface.
type FloatColumn ¶
func (*FloatColumn) Asc ¶ added in v0.1.5
func (c *FloatColumn) Asc() string
func (*FloatColumn) Desc ¶ added in v0.1.5
func (c *FloatColumn) Desc() string
func (*FloatColumn) EQ ¶
func (c *FloatColumn) EQ(v float64) *Clause
func (*FloatColumn) GE ¶
func (c *FloatColumn) GE(v float64) *Clause
func (*FloatColumn) GT ¶
func (c *FloatColumn) GT(v float64) *Clause
func (*FloatColumn) In ¶
func (c *FloatColumn) In(v []float64) *Clause
func (*FloatColumn) LE ¶
func (c *FloatColumn) LE(v float64) *Clause
func (*FloatColumn) LT ¶
func (c *FloatColumn) LT(v float64) *Clause
type Integer ¶
func NewInteger ¶
func NewNullableInteger ¶
func (Integer) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Integer) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type IntegerColumn ¶
func (*IntegerColumn) Asc ¶
func (c *IntegerColumn) Asc() string
func (*IntegerColumn) Desc ¶
func (c *IntegerColumn) Desc() string
func (*IntegerColumn) EQ ¶
func (c *IntegerColumn) EQ(v int32) *Clause
func (*IntegerColumn) GE ¶
func (c *IntegerColumn) GE(v int32) *Clause
func (*IntegerColumn) GT ¶
func (c *IntegerColumn) GT(v int32) *Clause
func (*IntegerColumn) In ¶
func (c *IntegerColumn) In(v []int32) *Clause
func (*IntegerColumn) LE ¶
func (c *IntegerColumn) LE(v int32) *Clause
func (*IntegerColumn) LT ¶
func (c *IntegerColumn) LT(v int32) *Clause
func (*IntegerColumn) NE ¶
func (c *IntegerColumn) NE(v int32) *Clause
type JSON ¶
func NewNullableJSON ¶
func NewNullableJSON(v interface{}) JSON
func (JSON) MarshalJSON ¶ added in v0.1.5
MarshalJSON implements the json.Marshaler interface.
func (*JSON) UnmarshalJSON ¶ added in v0.1.5
UnmarshalJSON implements the json.Unmarshaler interface.
type JSONColumn ¶
func (*JSONColumn) IsNull ¶
func (c *JSONColumn) IsNull() *Clause
func (*JSONColumn) NotNull ¶
func (c *JSONColumn) NotNull() *Clause
type SelectStatement ¶
type SelectStatement struct {
// contains filtered or unexported fields
}
func NewSelect ¶
func NewSelect() *SelectStatement
func (*SelectStatement) Delete ¶
func (s *SelectStatement) Delete() *DeleteStatemnet
convert select statement to delete statement
func (*SelectStatement) Distinct ¶
func (s *SelectStatement) Distinct(distinct ...string) *SelectStatement
func (*SelectStatement) From ¶
func (s *SelectStatement) From(from string) *SelectStatement
func (*SelectStatement) GroupBy ¶
func (s *SelectStatement) GroupBy(group string) *SelectStatement
func (*SelectStatement) Having ¶
func (s *SelectStatement) Having(having string) *SelectStatement
func (*SelectStatement) Join ¶
func (s *SelectStatement) Join(join ...string) *SelectStatement
func (*SelectStatement) Limit ¶
func (s *SelectStatement) Limit(limit int) *SelectStatement
func (*SelectStatement) Offset ¶
func (s *SelectStatement) Offset(offset int) *SelectStatement
func (*SelectStatement) Order ¶
func (s *SelectStatement) Order(order ...string) *SelectStatement
func (*SelectStatement) Select ¶
func (s *SelectStatement) Select(selection ...string) *SelectStatement
func (*SelectStatement) ToSQL ¶
func (s *SelectStatement) ToSQL() (string, []interface{})
func (*SelectStatement) Update ¶
func (s *SelectStatement) Update() *UpdateStatement
convert select statement to update statement
func (*SelectStatement) Where ¶
func (s *SelectStatement) Where(clauses ...*Clause) *SelectStatement
type String ¶
func NewNullableString ¶
func (String) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type StringColumn ¶
func (*StringColumn) Asc ¶
func (c *StringColumn) Asc() string
func (*StringColumn) Desc ¶
func (c *StringColumn) Desc() string
func (*StringColumn) EQ ¶
func (c *StringColumn) EQ(v string) *Clause
func (*StringColumn) EndsWith ¶
func (c *StringColumn) EndsWith(v string) *Clause
func (*StringColumn) IEQ ¶
func (c *StringColumn) IEQ(v string) *Clause
func (*StringColumn) IEndsWith ¶
func (c *StringColumn) IEndsWith(v string) *Clause
func (*StringColumn) ILike ¶
func (c *StringColumn) ILike(v string) *Clause
func (*StringColumn) IStartsWith ¶
func (c *StringColumn) IStartsWith(v string) *Clause
func (*StringColumn) In ¶
func (c *StringColumn) In(v []string) *Clause
func (*StringColumn) Like ¶
func (c *StringColumn) Like(v string) *Clause
func (*StringColumn) NE ¶
func (c *StringColumn) NE(v string) *Clause
func (*StringColumn) StartsWith ¶
func (c *StringColumn) StartsWith(v string) *Clause
type Table ¶
type Table struct {
Name string
}
func (*Table) NewBigIntColumn ¶
func (t *Table) NewBigIntColumn(name string) *BigIntColumn
func (*Table) NewBooleanColumn ¶
func (t *Table) NewBooleanColumn(name string) *BooleanColumn
func (*Table) NewFloatColumn ¶
func (t *Table) NewFloatColumn(name string) *FloatColumn
func (*Table) NewIntegerColumn ¶
func (t *Table) NewIntegerColumn(name string) *IntegerColumn
func (*Table) NewJSONColumn ¶
func (t *Table) NewJSONColumn(name string) *JSONColumn
func (*Table) NewStringColumn ¶
func (t *Table) NewStringColumn(name string) *StringColumn
func (*Table) NewUUIDColumn ¶
func (t *Table) NewUUIDColumn(name string) *UUIDColumn
type UUID ¶
func NewNullableUUID ¶
func (UUID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*UUID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type UUIDColumn ¶
func (*UUIDColumn) Asc ¶ added in v0.1.5
func (c *UUIDColumn) Asc() string
func (*UUIDColumn) Desc ¶ added in v0.1.5
func (c *UUIDColumn) Desc() string
func (*UUIDColumn) EQ ¶
func (c *UUIDColumn) EQ(v string) *Clause
func (*UUIDColumn) NE ¶
func (c *UUIDColumn) NE(v string) *Clause
type UpdateStatement ¶
type UpdateStatement struct {
// contains filtered or unexported fields
}
func NewUpdate ¶
func NewUpdate() *UpdateStatement
func (*UpdateStatement) Columns ¶
func (s *UpdateStatement) Columns(columns ...string) *UpdateStatement
func (*UpdateStatement) Returning ¶
func (s *UpdateStatement) Returning(returning string) *UpdateStatement
func (*UpdateStatement) Table ¶
func (s *UpdateStatement) Table(table string) *UpdateStatement
func (*UpdateStatement) ToSQL ¶
func (s *UpdateStatement) ToSQL() (string, []interface{})
func (*UpdateStatement) Values ¶
func (s *UpdateStatement) Values(values ...interface{}) *UpdateStatement
func (*UpdateStatement) Where ¶
func (s *UpdateStatement) Where(expr *Clause) *UpdateStatement
Source Files ¶
- adapter.mysql.go
- adapter.postgresql.go
- adapter.sqlite.go
- adapter_test.postgresql.go
- bigint.go
- bigint_column.go
- bind.go
- boolean.go
- boolean_column.go
- clause.go
- db.go
- delete.go
- env.go
- float.go
- float_column.go
- integer.go
- integer_column.go
- json.go
- json_column.go
- logger.go
- scan.go
- select.go
- string.go
- string_column.go
- table.go
- update.go
- uuid.go
- uuid_column.go