Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildError ¶
BuildError is the error type usually returned by functions in the stmt package. It describes the current operation, occurred of an error.
func (*BuildError) Error ¶
func (b *BuildError) Error() string
func (*BuildError) Unwrap ¶
func (b *BuildError) Unwrap() error
Unwrap unwraps the wrapped error. This method is implemented to satisfy an interface of errors.Unwap.
type Builder ¶
type Builder interface { WritePlaceholder() WriteString(string) AppendArgs(args ...interface{}) }
Builder an interface used to build SQL queries.
WriteString method uses the passed string is writing to the query builder. AppendArgs method uses for pass arguments corresponding to variables.
type CompBetween ¶
type CompBetween struct { Negative bool Left interface{} Right interface{} }
CompBetween represents condition for using "BETWEEN".
If enabled Negative field, it's meaning use "NOT BETWEEN". This struct will convert to be like "BETWEEN left_expr AND right_expr".
func (*CompBetween) WriteComparison ¶
func (c *CompBetween) WriteComparison(b Builder) error
WriteComparison implemented Comparisoner interface.
type CompIn ¶
type CompIn struct { Negative bool Values []interface{} }
CompIn represents condition for using "IN".
If enabled Negative field, it's meaning use "NOT IN". Values field should set list to use for comparison. This struct will convert to be like "IN (?, ?, ?)".
func (*CompIn) WriteComparison ¶
WriteComparison implemented Comparisoner interface.
type CompLike ¶
type CompLike struct { Negative bool Value interface{} }
CompLike represents condition for using "LIKE".
If enabled Negative field, it's meaning use "NOT LIKE". Value field should set the value to use for comparison.
func (*CompLike) WriteComparison ¶
WriteComparison implemented Comparisoner interface.
type CompOp ¶
type CompOp struct { Op string Value interface{} }
CompOp represents condition for using operators.
Op field should contain "=", ">=", ">", "<=", "<", "!=", "IS", "IS NOT" Value field should set the value to use for comparison.
func (*CompOp) WriteComparison ¶
WriteComparison implemented Comparisoner interface.
type Comparisoner ¶
Comparisoner implemented WriteComparison method.
This interface represents a conditional expression.
type Condition ¶
type Condition struct { Column string Compare Comparisoner }
Condition represents condition for using Comparisoner interface.
this struct creates "<column_name> <comparable_condition>" <comparable_condition> indicates Comparisoner interface.
type Numeric ¶ added in v0.0.2
type Numeric int64
Numeric is able to replace bindvars with numeric.
i.e. "LIMIT ?" => "LIMIT numeric"
type OrderBy ¶ added in v0.0.2
OrderBy represents "<column_name>", "<column_name> DESC". If there is Next, it represents like "<column_name>, <column_name> DESC".