Documentation
¶
Index ¶
- func ToPositional(placeholder string, expr Expression) (string, []any, error)
- type Append
- type Builder
- func (b *Builder) Append(expressions ...Expression) *Builder
- func (b *Builder) If(condition bool, then Expression) *Builder
- func (b *Builder) IfElse(condition bool, then Expression, els Expression) *Builder
- func (b *Builder) Join(sep string, expressions ...Expression) *Builder
- func (b *Builder) SQL(sql string, args ...any) *Builder
- func (b *Builder) Space() *Builder
- func (b *Builder) ToSQL() (string, []any, error)
- type Delete
- type Expression
- type ExpressionError
- type Insert
- type Join
- type NumberOfArgumentsError
- type Query
- type Raw
- type Update
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToPositional ¶ added in v0.0.11
func ToPositional(placeholder string, expr Expression) (string, []any, error)
Types ¶
type Append ¶
type Append []Expression
type Builder ¶ added in v0.0.5
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) Append ¶ added in v0.2.1
func (b *Builder) Append(expressions ...Expression) *Builder
func (*Builder) IfElse ¶ added in v0.2.1
func (b *Builder) IfElse(condition bool, then Expression, els Expression) *Builder
type Delete ¶ added in v0.0.3
type Delete struct {
From string
Where Expression
}
type Expression ¶
func If ¶
func If(condition bool, then Expression) Expression
func IfElse ¶ added in v0.0.4
func IfElse(condition bool, then, els Expression) Expression
type ExpressionError ¶ added in v0.0.11
type ExpressionError struct {
Err error
}
ExpressionError is returned if expressions are nil.
func (ExpressionError) Error ¶ added in v0.0.11
func (e ExpressionError) Error() string
func (ExpressionError) Unwrap ¶ added in v0.2.0
func (e ExpressionError) Unwrap() error
type Join ¶
type Join struct {
Sep string
Expressions []Expression
}
type NumberOfArgumentsError ¶ added in v0.0.11
type NumberOfArgumentsError struct {
Got, Want int
}
NumberOfArgumentsError is returned if arguments doesn't match the number of placeholders.
func (NumberOfArgumentsError) Error ¶ added in v0.0.11
func (e NumberOfArgumentsError) Error() string
type Query ¶ added in v0.0.6
type Query struct {
With Expression
Select Expression
From Expression
Where Expression
GroupBy Expression
Having Expression
Window Expression
OrderBy Expression
Limit uint64
Offset uint64
}
type Raw ¶ added in v0.2.1
type Update ¶ added in v0.0.3
type Update struct {
Table string
Sets []Expression
Where Expression
}
Click to show internal directories.
Click to hide internal directories.