Documentation ¶
Overview ¶
Example (IsZero) ¶
type thing struct{} var e any fmt.Println(isZero(e)) e = &thing{} fmt.Println(isZero(e)) fmt.Println(isZero(&thing{})) fmt.Println(isZero((*thing)(nil))) fmt.Println(isZero(thing{}))
Output: true false false true true
Index ¶
- func MapIDField[E Entity[I], I ID](m *FieldMap[E], col *bsq.Column)
- type Base
- type DBRepo
- func (r *DBRepo[E, I]) Create(q sqlize.Querier, entity E) (E, error)
- func (r *DBRepo[E, ID]) Delete(q sqlize.Querier, id ID) error
- func (r *DBRepo[E, I]) Prepare(db *sql.DB) error
- func (r *DBRepo[E, ID]) Read(q sqlize.Querier, id ID, reuse E) (E, error)
- func (r *DBRepo[E, ID]) ReadContext(ctx context.Context, q sqlize.Querier, id ID, reuse E) (E, error)
- func (r *DBRepo[E, ID]) Update(q sqlize.Querier, entity E) error
- type Entity
- type FieldMap
- func (m *FieldMap[E]) BindOut(e E, hint any, reuse []any, cols ...*bsq.Column) []any
- func (m *FieldMap[E]) BindParams(e E, hint any, reuse []any, cols ...*bsq.Column) []any
- func (m *FieldMap[E]) Clone() *FieldMap[E]
- func (m *FieldMap[E]) FromSQL(i int) MapFunc[E]
- func (m *FieldMap[E]) MapBoth(col *bsq.Column, tofrom MapFunc[E])
- func (m *FieldMap[E]) MapFrom(col *bsq.Column, from MapFunc[E])
- func (m *FieldMap[E]) MapMethods(mode MapMode, cols ...*bsq.Column) error
- func (m *FieldMap[E]) MapTo(col *bsq.Column, to MapFunc[E])
- func (m *FieldMap[E]) MapToAndFrom(col *bsq.Column, toSQL, fromSQL MapFunc[E])
- func (m *FieldMap[E]) ToSQL(i int) MapFunc[E]
- type ID
- type ID16
- type ID32
- type ID64
- type MapFunc
- type MapMode
- type Reader
- type Ref
- func (ref *Ref[E, ID]) Get(db sqlize.Querier) (entity E, err error)
- func (ref *Ref[E, ID]) GetContext(ctx context.Context, db sqlize.Querier) (entity E, err error)
- func (ref Ref[E, ID]) ID() ID
- func (ref *Ref[E, ID]) Nil() bool
- func (ref *Ref[E, ID]) Resolved() (is bool, entity E)
- func (ref *Ref[E, I]) Scanner(r Reader[E, I]) refScanner[E, I]
- func (ref *Ref[E, ID]) Set(entity E)
- func (ref *Ref[E, ID]) SetID(r Reader[E, ID], id ID)
- func (ref *Ref[E, ID]) SetReader(r Reader[E, ID])
- func (ref *Ref[E, ID]) SetRef(r Ref[E, ID])
- func (ref Ref[E, ID]) Value() (driver.Value, error)
- func (ref Ref[E, ID]) WithReader(r Reader[E, ID]) (res Ref[E, ID])
- type Repo
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldMap ¶
type FieldMap[E any] struct { // contains filtered or unexported fields }
func (*FieldMap[E]) BindParams ¶
func (*FieldMap[E]) MapMethods ¶
func (*FieldMap[E]) MapToAndFrom ¶
type MapMode ¶
type MapMode uint
const ( MapAllTo MapMode = (1 << iota) MapAllFrom MapAll = MapAllTo | MapAllFrom )
Click to show internal directories.
Click to hide internal directories.