Versions in this module Expand all Collapse all v1 v1.1.15 Jun 17, 2023 v1.1.14 May 31, 2023 v1.1.13 May 4, 2023 v1.1.12 May 4, 2023 Changes in this version + const BelongsToRelation + const HasManyRelation + const HasOneRelation + const InvalidRelation + const ManyToManyRelation + func Append(fmter Formatter, b []byte, v interface{}) []byte + func AppendBoolValue(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendFloat32Value(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendFloat64Value(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendIntValue(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendJSONValue(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendQueryAppender(fmter Formatter, b []byte, app QueryAppender) []byte + func AppendStringValue(fmter Formatter, b []byte, v reflect.Value) []byte + func AppendUintValue(fmter Formatter, b []byte, v reflect.Value) []byte + func DiscoverSQLType(typ reflect.Type) string + func SetTableNameInflector(fn func(string) string) + type AfterScanHook interface + AfterScan func(context.Context) error + type AfterScanRowHook interface + AfterScanRow func(context.Context) error + type AppenderFunc func(fmter Formatter, b []byte, v reflect.Value) []byte + func Appender(dialect Dialect, typ reflect.Type) AppenderFunc + func FieldAppender(dialect Dialect, field *Field) AppenderFunc + func PtrAppender(fn AppenderFunc) AppenderFunc + type BaseDialect struct + func (BaseDialect) AppendBool(b []byte, v bool) []byte + func (BaseDialect) AppendBytes(b, bs []byte) []byte + func (BaseDialect) AppendJSON(b, jsonb []byte) []byte + func (BaseDialect) AppendString(b []byte, s string) []byte + func (BaseDialect) AppendTime(b []byte, tm time.Time) []byte + func (BaseDialect) AppendUint32(b []byte, n uint32) []byte + func (BaseDialect) AppendUint64(b []byte, n uint64) []byte + type BaseModel struct + type BeforeAppendModelHook interface + BeforeAppendModel func(ctx context.Context, query Query) error + type BeforeScanHook interface + BeforeScan func(context.Context) error + type BeforeScanRowHook interface + BeforeScanRow func(context.Context) error + type ColumnsAppender interface + AppendColumns func(fmter Formatter, b []byte) ([]byte, error) + type CustomAppender func(typ reflect.Type) AppenderFunc + type Dialect interface + AppendBool func(b []byte, v bool) []byte + AppendBytes func(b []byte, bs []byte) []byte + AppendJSON func(b, jsonb []byte) []byte + AppendString func(b []byte, s string) []byte + AppendTime func(b []byte, tm time.Time) []byte + AppendUint32 func(b []byte, n uint32) []byte + AppendUint64 func(b []byte, n uint64) []byte + DefaultVarcharLen func() int + Features func() feature.Feature + IdentQuote func() byte + Init func(db *sql.DB) + Name func() dialect.Name + OnTable func(table *Table) + Tables func() *Tables + type Field struct + Append AppenderFunc + AutoIncrement bool + CreateTableSQLType string + DiscoveredSQLType string + GoName string + Identity bool + Index []int + IndirectType reflect.Type + IsPK bool + IsPtr bool + IsZero IsZeroerFunc + Name string + NotNull bool + NullZero bool + OnDelete string + OnUpdate string + SQLDefault string + SQLName Safe + Scan ScannerFunc + StructField reflect.StructField + Tag tagparser.Tag + UserSQLType string + func (f *Field) AppendValue(fmter Formatter, b []byte, strct reflect.Value) []byte + func (f *Field) Clone() *Field + func (f *Field) HasNilValue(v reflect.Value) bool + func (f *Field) HasZeroValue(v reflect.Value) bool + func (f *Field) ScanValue(strct reflect.Value, src interface{}) error + func (f *Field) ScanWithCheck(fv reflect.Value, src interface{}) error + func (f *Field) SkipUpdate() bool + func (f *Field) String() string + func (f *Field) Value(strct reflect.Value) reflect.Value + type Formatter struct + func NewFormatter(dialect Dialect) Formatter + func NewNopFormatter() Formatter + func (f Formatter) AppendIdent(b []byte, ident string) []byte + func (f Formatter) AppendQuery(dst []byte, query string, args ...interface{}) []byte + func (f Formatter) AppendValue(b []byte, v reflect.Value) []byte + func (f Formatter) Dialect() Dialect + func (f Formatter) FormatQuery(query string, args ...interface{}) string + func (f Formatter) HasFeature(feature feature.Feature) bool + func (f Formatter) IdentQuote() byte + func (f Formatter) IsNop() bool + func (f Formatter) WithArg(arg NamedArgAppender) Formatter + func (f Formatter) WithNamedArg(name string, value interface{}) Formatter + type Ident string + func (s Ident) AppendQuery(fmter Formatter, b []byte) ([]byte, error) + type IsZeroerFunc func(reflect.Value) bool + type Model interface + ScanRows func(ctx context.Context, rows *sql.Rows) (int, error) + Value func() interface{} + type NamedArgAppender interface + AppendNamedArg func(fmter Formatter, b []byte, name string) ([]byte, bool) + type NullTime struct + func (tm *NullTime) Scan(src interface{}) error + func (tm *NullTime) UnmarshalJSON(b []byte) error + func (tm NullTime) AppendQuery(fmter Formatter, b []byte) ([]byte, error) + func (tm NullTime) MarshalJSON() ([]byte, error) + type Query interface + GetModel func() Model + GetTableName func() string + Operation func() string + type QueryAppender interface + AppendQuery func(fmter Formatter, b []byte) ([]byte, error) + func In(slice interface{}) QueryAppender + type QueryWithArgs struct + Args []interface{} + Query string + func SafeQuery(query string, args []interface{}) QueryWithArgs + func UnsafeIdent(ident string) QueryWithArgs + func (q QueryWithArgs) AppendQuery(fmter Formatter, b []byte) ([]byte, error) + func (q QueryWithArgs) IsZero() bool + type QueryWithSep struct + Sep string + func SafeQueryWithSep(query string, args []interface{}, sep string) QueryWithSep + type Relation struct + BaseFields []*Field + Condition []string + Field *Field + JoinFields []*Field + JoinTable *Table + M2MBaseFields []*Field + M2MJoinFields []*Field + M2MTable *Table + OnDelete string + OnUpdate string + PolymorphicField *Field + PolymorphicValue string + Type int + func (r *Relation) String() string + type Safe string + func (s Safe) AppendQuery(fmter Formatter, b []byte) ([]byte, error) + type ScannerFunc func(dest reflect.Value, src interface{}) error + func FieldScanner(dialect Dialect, field *Field) ScannerFunc + func PtrScanner(fn ScannerFunc) ScannerFunc + func Scanner(typ reflect.Type) ScannerFunc + type Table struct + Alias string + DataFields []*Field + FieldMap map[string]*Field + Fields []*Field + ModelName string + Name string + PKs []*Field + Relations map[string]*Relation + SQLAlias Safe + SQLName Safe + SQLNameForSelects Safe + SoftDeleteField *Field + Type reflect.Type + TypeName string + Unique map[string][]*Field + UpdateSoftDeleteField func(fv reflect.Value, tm time.Time) error + ZeroIface interface{} + ZeroValue reflect.Value + func (t *Table) AppendNamedArg(fmter Formatter, b []byte, name string, strct reflect.Value) ([]byte, bool) + func (t *Table) CheckPKs() error + func (t *Table) Dialect() Dialect + func (t *Table) Field(name string) (*Field, error) + func (t *Table) HasAfterScanHook() bool + func (t *Table) HasAfterScanRowHook() bool + func (t *Table) HasBeforeAppendModelHook() bool + func (t *Table) HasBeforeScanHook() bool + func (t *Table) HasBeforeScanRowHook() bool + func (t *Table) HasField(name string) bool + func (t *Table) String() string + type Tables struct + func NewTables(dialect Dialect) *Tables + func (t *Tables) ByModel(name string) *Table + func (t *Tables) ByName(name string) *Table + func (t *Tables) Get(typ reflect.Type) *Table + func (t *Tables) Ref(typ reflect.Type) *Table + func (t *Tables) Register(models ...interface{})