Documentation ¶
Index ¶
- Variables
- 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 QueryExecer
- type SQLResult
- type Tabler
- 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 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
}
type QueryExecer ¶ added in v0.18.0
type QueryExecer interface { sqlx.QueryerContext sqlx.ExecerContext }
type Tag ¶ added in v0.16.5
type Tag struct { Name string Primary bool AutoIncrement bool Readonly bool Index bool Type dialects.DataType }
func DBTag ¶
func DBTag(f reflect.StructField) *Tag
Click to show internal directories.
Click to hide internal directories.