Documentation ¶
Index ¶
- Variables
- func Create(t reflect.Type) reflect.Value
- func Each(v any, cb func(v reflect.Value, pointer bool) error) error
- func EachField(v reflect.Value, cb func(sf reflect.StructField, fv reflect.Value) error) error
- func FieldName(f reflect.StructField) string
- func GetType[T any]() reflect.Type
- 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 NewOf[T any]() T
- func PrimaryKey(m any) []string
- func PrimaryKeyValue(m any) []any
- func RGetValue(rv reflect.Value, key string) (any, bool)
- type PrimaryKeyer
- type SQLResult
- type Tag
- 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 FieldName ¶
func FieldName(f reflect.StructField) string
func Includes ¶
func Includes[T comparable](arr []T, v T) bool
func PrimaryKey ¶
func PrimaryKeyValue ¶ added in v0.8.0
Types ¶
type PrimaryKeyer ¶
type PrimaryKeyer interface {
PrimaryKey() []string
}
type Tag ¶
type Tag struct { Name string Primary bool AutoIncrement bool Readonly bool Index bool Unique bool Type dialects.DataType }
func DBTag ¶
func DBTag(f reflect.StructField) *Tag
Click to show internal directories.
Click to hide internal directories.