Documentation ¶
Index ¶
- Variables
- func DBTag(f reflect.StructField) []string
- func EachField(v reflect.Value, cb func(sf reflect.StructField, fv reflect.Value) error) error
- func FieldName(f reflect.StructField) string
- func GetTable(m any) string
- func GetTableSingular(m any) string
- func GetValue(v any, key string) (any, bool)
- func HasField(v any, field string) bool
- func Includes[T comparable](arr []T, v T) bool
- func PrimaryKey(m any) []string
- func RGetValue(rv reflect.Value, key string) (any, bool)
- type PrimaryKeyer
- type SQLResult
- type Tabler
- type ToSQLFunc
- type ToSQLer
- func Concat(sqlers ...ToSQLer) ToSQLer
- func Group(sqler ToSQLer) ToSQLer
- func Identifier(i string) ToSQLer
- func IdentifierList(strs []string) []ToSQLer
- func Join[T ToSQLer](sqlers []T, sep string) ToSQLer
- func Literal(v any) ToSQLer
- func LiteralList(values []any) []ToSQLer
- func Raw(sql string, bindings ...any) ToSQLer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExpectedStruct = fmt.Errorf("expected a struct")
)
Functions ¶
func DBTag ¶
func DBTag(f reflect.StructField) []string
func FieldName ¶
func FieldName(f reflect.StructField) string
func GetTableSingular ¶
func Includes ¶ added in v0.14.0
func Includes[T comparable](arr []T, v T) bool
func PrimaryKey ¶
Types ¶
type PrimaryKeyer ¶
type PrimaryKeyer interface {
PrimaryKey() []string
}
Click to show internal directories.
Click to hide internal directories.