Documentation
¶
Index ¶
- Constants
- Variables
- func ColumnNameFromDbTag(f reflect.StructField) string
- func DebugQuery(query squirrel.Sqlizer)
- func DebugQueryPieces(sql string, args []interface{}, err error)
- func DefaultCoalescer(t reflect.Type, s *SelectTags) string
- func Exists(db sqlx.Queryer, qry squirrel.SelectBuilder) (bool, error)
- func Get(db sqlx.Queryer, val interface{}, qry squirrel.SelectBuilder) error
- func GetColumnsByTag(val interface{}, prefix string, filterFields ...string) map[string]string
- func GetColumnsByTagExcl(val interface{}, prefix string, filterFields ...string) map[string]string
- func GetColumnsForSet(set string, val interface{}, prefix string, filterFields ...string) []string
- func GetColumnsForSetExcl(set string, val interface{}, prefix string, filterFields ...string) []string
- func GetColumnsList(val interface{}, prefix string, filterFields ...string) []string
- func GetColumnsListExcl(val interface{}, prefix string, filterFields ...string) []string
- func IterateColumnNames(set string, val interface{}, it SelectIterator, invert bool, ...)
- func IteratePgFields(val interface{}, isInsert bool, it SetMapIterator)
- func MkJoinStr(t1, c1, t2, c2 string) string
- func QuickExecTx(tx sqlx.Execer, queries []string, arg ...interface{}) error
- func QuickRows(db sqlx.Queryer, qry squirrel.SelectBuilder, fn RowHandler) error
- func RunMulti(tx *sqlx.Tx, fns []TxFunc) error
- func RunMultiExt(ext sqlx.Ext, fns []ExtFunc) error
- func Select(db sqlx.Queryer, slice interface{}, qry squirrel.SelectBuilder) error
- func SetCoalescer(c Coalescer)
- func SetMap(val interface{}, isInsert bool) map[string]interface{}
- func TxNow(db *sqlx.DB, fn TxFunc) error
- func TxNowMulti(db *sqlx.DB, fn []TxFunc) error
- func Union(selects ...squirrel.SelectBuilder) (squirrel.SelectBuilder, error)
- type Coalescer
- type ExtFunc
- type ILikeAnd
- type ILikeOr
- type InvalidUnionError
- type RowHandler
- type SelectIterator
- type SelectTags
- type SetMapIterator
- type SetMapTags
- type TxFunc
Constants ¶
View Source
const SelectSetTagName = "select-sets"
View Source
const SelectTagName = "select"
View Source
const SetMapTagName = "setmap"
Variables ¶
View Source
var (
ErrNoSelects = errors.New("no selects")
)
Functions ¶
func ColumnNameFromDbTag ¶
func ColumnNameFromDbTag(f reflect.StructField) string
func DebugQuery ¶
func DebugQueryPieces ¶
func DefaultCoalescer ¶
func DefaultCoalescer(t reflect.Type, s *SelectTags) string
func GetColumnsByTag ¶
func GetColumnsByTagExcl ¶
func GetColumnsForSet ¶
func GetColumnsForSetExcl ¶
func GetColumnsList ¶
func GetColumnsListExcl ¶
func IterateColumnNames ¶
func IterateColumnNames(set string, val interface{}, it SelectIterator, invert bool, filterFields ...string)
func IteratePgFields ¶
func IteratePgFields(val interface{}, isInsert bool, it SetMapIterator)
func QuickRows ¶
func QuickRows(db sqlx.Queryer, qry squirrel.SelectBuilder, fn RowHandler) error
func SetCoalescer ¶
func SetCoalescer(c Coalescer)
func Union ¶
func Union(selects ...squirrel.SelectBuilder) (squirrel.SelectBuilder, error)
Allows for unions queries. Created another select query using suffixes. Where and Join queries should not be made after calling this query, as those queries will only affect the *first* query on the list.
Types ¶
type Coalescer ¶
type Coalescer func(reflect.Type, *SelectTags) string
var CoalesceFromType Coalescer = DefaultCoalescer
type InvalidUnionError ¶
func (InvalidUnionError) Error ¶
func (e InvalidUnionError) Error() string
type RowHandler ¶
type SelectIterator ¶
type SelectIterator func(name string, f reflect.StructField, t *SelectTags)
type SelectTags ¶
func (*SelectTags) ContainsSet ¶
func (t *SelectTags) ContainsSet(set string) bool
func (*SelectTags) Parse ¶
func (t *SelectTags) Parse(str string)
func (*SelectTags) ParseSets ¶
func (t *SelectTags) ParseSets(str string)
type SetMapIterator ¶
type SetMapIterator func(string, interface{})
type SetMapTags ¶
func ParseSetMapTags ¶
func ParseSetMapTags(str string) *SetMapTags
func (*SetMapTags) Parse ¶
func (t *SetMapTags) Parse(str string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.