Documentation ¶
Index ¶
- func Build(q Query, writerOptions ...WriterOption) (string, []any, error)
- func Express(w Writer, d Dialect, start int, e Expression) ([]any, error)
- func ExpressIf(w Writer, d Dialect, start int, e Expression, cond bool, ...) ([]any, error)
- func ExpressSlice(w Writer, d Dialect, start int, expressions []Expression, ...) ([]any, error)
- func ParseArgs(args []any, values ...ArgValues) ([]any, error)
- type ArgValues
- type Argument
- type ArgumentBase
- type BuildQuery
- type DBNamedArgument
- type Dialect
- type DialectWithNamed
- type ExpressBuilder
- func (h *ExpressBuilder) Err() error
- func (h *ExpressBuilder) Express(e Expression)
- func (h *ExpressBuilder) ExpressIf(e Expression, cond bool, prefix, suffix Expression)
- func (h *ExpressBuilder) ExpressSlice(expressions []Expression, prefix, sep, suffix Expression)
- func (h *ExpressBuilder) Result() ([]any, error)
- func (h *ExpressBuilder) WriteQuery(e Query)
- type Expression
- type ExpressionFunc
- type MapArgValues
- type NamedArgument
- type Query
- type QueryBuilder
- type QueryClause
- type QueryClauseMerge
- type QueryClauseMultiple
- type QueryClauseWrapper
- type ValuedArgument
- type Writer
- type WriterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpressIf ¶
func ExpressIf(w Writer, d Dialect, start int, e Expression, cond bool, prefix, suffix Expression) ([]any, error)
ExpressIf expands an express if the condition evaluates to true it can also add a prefix and suffix
func ExpressSlice ¶
func ExpressSlice(w Writer, d Dialect, start int, expressions []Expression, prefix, sep, suffix Expression) ([]any, error)
ExpressSlice is used to express a slice of expressions along with a prefix and suffix
Types ¶
type Argument ¶
type Argument interface {
// contains filtered or unexported methods
}
func ArgDefault ¶
type ArgumentBase ¶
type ArgumentBase struct{}
type BuildQuery ¶
type BuildQuery interface {
Build(writerOptions ...WriterOption) (string, []any, error)
}
type DBNamedArgument ¶
func DBArg ¶
func DBArg(name string) DBNamedArgument
type DialectWithNamed ¶
type ExpressBuilder ¶
type ExpressBuilder struct {
// contains filtered or unexported fields
}
ExpressBuilder builds arguments in a sequence of Express calls.
func NewExpressBuilder ¶
func NewExpressBuilder(w Writer, d Dialect, start int) *ExpressBuilder
func (*ExpressBuilder) Err ¶
func (h *ExpressBuilder) Err() error
func (*ExpressBuilder) Express ¶
func (h *ExpressBuilder) Express(e Expression)
func (*ExpressBuilder) ExpressIf ¶
func (h *ExpressBuilder) ExpressIf(e Expression, cond bool, prefix, suffix Expression)
func (*ExpressBuilder) ExpressSlice ¶
func (h *ExpressBuilder) ExpressSlice(expressions []Expression, prefix, sep, suffix Expression)
func (*ExpressBuilder) Result ¶
func (h *ExpressBuilder) Result() ([]any, error)
func (*ExpressBuilder) WriteQuery ¶
func (h *ExpressBuilder) WriteQuery(e Query)
type Expression ¶
type ExpressionFunc ¶
type MapArgValues ¶
type NamedArgument ¶
type Query ¶
type Query interface { Expression WriteQuery(w Writer, start int) (args []any, err error) }
type QueryBuilder ¶
type QueryBuilder interface { Dialect() Dialect Add(q QueryClause) }
type QueryClause ¶
type QueryClause interface { Expression ClauseOrder() int }
type QueryClauseMerge ¶
type QueryClauseMerge interface { QueryClause ClauseMerge(other QueryClause) }
type QueryClauseMultiple ¶
type QueryClauseMultiple interface { QueryClause ClauseMultiple() }
type QueryClauseWrapper ¶
type QueryClauseWrapper interface {
WrappedQueryClause() QueryClause
}
type ValuedArgument ¶
type Writer ¶
type WriterOption ¶
type WriterOption func(*writer)
func WithWriterIndentStr ¶
func WithWriterIndentStr(indentStr string) WriterOption
func WithWriterUseNewLine ¶
func WithWriterUseNewLine(useNewLine bool) WriterOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.