Documentation ¶
Index ¶
- Constants
- func Explode(sep string, v ...string) []string
- func ExtractStructTags(v any, tag ...string) []string
- func Get[T Row](db sqlx.Queryer, dst *T, args ...SelectArg) error
- func GetContext[T Row](ctx context.Context, db sqlx.QueryerContext, dst *T, args ...SelectArg) error
- func RemoveDuplicates[T comparable](v []T) []T
- func Select[T Row](db sqlx.Queryer, dst *[]T, args ...SelectArg) error
- func SelectContext[T Row](ctx context.Context, db sqlx.QueryerContext, dst *[]T, args ...SelectArg) error
- func ToSnakeCase(str string) string
- type Optional
- type Row
- type RowWithJoin
- type SelectArg
- type WithSelectColumns
Constants ¶
View Source
const (
TableReplacer = "{t}"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractStructTags ¶
func GetContext ¶
func RemoveDuplicates ¶
func RemoveDuplicates[T comparable](v []T) []T
func SelectContext ¶
func ToSnakeCase ¶
Types ¶
type Optional ¶
type Optional[T comparable] struct { Val T Valid bool }
func Opt ¶
func Opt[T comparable](v T) Optional[T]
func Optz ¶
func Optz[T comparable](v T) Optional[T]
Optz checks if v is the zero value equivalent of T. If true, the Valid field of the Optional is set to false.
type Row ¶
type Row interface { comparable Table() string }
type RowWithJoin ¶
type RowWithJoin interface {
TableJoins()
}
type SelectArg ¶
type SelectArg func(b squirrel.SelectBuilder) squirrel.SelectBuilder
type WithSelectColumns ¶
type WithSelectColumns interface {
SelectColumns() []string
}
Click to show internal directories.
Click to hide internal directories.