Documentation
¶
Overview ¶
Package qbuilder implements a simple, fast and easy-to-use query builder for jmoiron/sqlx.
Index ¶
- Variables
- type Formatter
- type Selection
- func (s *Selection) BindVar(v string) *Selection
- func (s *Selection) Exclude(fields ...string) *Selection
- func (s *Selection) FieldSeparator(v string) *Selection
- func (s *Selection) Fmt(format string) string
- func (s *Selection) Formatter() *Formatter
- func (s *Selection) Only(fields ...string) *Selection
- func (s *Selection) TagKey(v string) *Selection
- func (s *Selection) TypeTagKey(v string) *Selection
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotStructKind means that the given argument to Select() is not a struct kind. ErrNotStructKind = errors.New("argument is not a struct kind") // ErrFilterSet means that filters were already set. ErrFilterSet = errors.New("filters already set") )
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter can format strings after a Selection is made.
func (*Formatter) BindVars ¶
BindVars returns a formatted string containing the bind var placeholders.
func (*Formatter) FieldNames ¶
FieldNames returns the field names.
func (*Formatter) FieldTypes ¶
FieldTypes returns the field types.
func (*Formatter) Fmt ¶
Fmt builds a string using format. The following strings are replaced:
$bindvars with the output of BindVars() $names with the output of Names() $updates with the output of Updates() $table with the output of Table()
type Selection ¶
type Selection struct {
// contains filtered or unexported fields
}
Selection contains the selected fields and options.
func Select ¶
func Select(s interface{}) *Selection
Select selecs all the fields of s and returns a Selection.
func (*Selection) FieldSeparator ¶
FieldSeparator sets the field separator for the formatter.
func (*Selection) TypeTagKey ¶
TypeTagKey sets the struct field tag key for types to use in this Selection.
Click to show internal directories.
Click to hide internal directories.