Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AndFragment ¶
type AndFragment []ConditionFragment
AndFragment combines sub-fragments with AND operator
func (AndFragment) GetConditionFragment ¶
func (a AndFragment) GetConditionFragment(c *PositionalCounter) (string, []interface{})
GetConditionFragment returns fragment with its parameter
type ConditionFragment ¶
type ConditionFragment interface { // GetConditionFragment returns ConditionFragment stringified GetConditionFragment(*PositionalCounter) (string, []interface{}) }
ConditionFragment represents a condition fragment
type ConstantFragment ¶
type ConstantFragment struct {
Constant string
}
ConstantFragment holds constant expression, without parameters
func (*ConstantFragment) GetConditionFragment ¶
func (c *ConstantFragment) GetConditionFragment(*PositionalCounter) (string, []interface{})
GetConditionFragment returns the constant fragment
type DBInterface ¶
type DBInterface interface { Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error) Query(ctx context.Context, query string, args ...any) (pgx.Rows, error) QueryRow(ctx context.Context, query string, args ...any) pgx.Row }
DBInterface holds common operations for sql.DB and sql.Tx
type OrFragment ¶
type OrFragment []ConditionFragment
OrFragment combines sub-fragments with OR operator
func (OrFragment) GetConditionFragment ¶
func (o OrFragment) GetConditionFragment(c *PositionalCounter) (string, []interface{})
GetConditionFragment returns fragment with its parameter
type PositionalCounter ¶
type PositionalCounter struct {
// contains filtered or unexported fields
}
PositionalCounter generates positional parameter markers
func (*PositionalCounter) Get ¶
func (p *PositionalCounter) Get() string
Get generates next positional parameter marker
type UnaryFragment ¶
type UnaryFragment struct { Frag string Param interface{} }
UnaryFragment holds fragment with one parameter
func (*UnaryFragment) GetConditionFragment ¶
func (u *UnaryFragment) GetConditionFragment(p *PositionalCounter) (string, []interface{})
GetConditionFragment returns fragment with its parameter