Versions in this module Expand all Collapse all v3 v3.13.1 Sep 21, 2022 Changes in this version + const OrderTypeAsc + const OrderTypeDesc + const OrderTypeUnordered + var DefaultIndex = newIndex("ID") + var DefaultKey = "ID" + var DefaultModel = NewModel() + var ErrorMultipleRecordsFound = errors.New("multiple records found") + var ErrorNilInterface = errors.New("interface is nil") + var ErrorNotFound = errors.New("not found") + type Index struct + Base32Encode bool + FieldName string + Float32Max float32 + Float64Max float64 + FloatFormat string + Order Order + StringOrderPadLength int + Type string + Unique bool + func ByEquality(fieldName string) Index + func (i Index) ToQuery(value interface{}) Query + type Model interface + Context func(ctx context.Context) Model + Create func(v interface{}) error + Delete func(query Query) error + Read func(query Query, resultPointer interface{}) error + Register func(v interface{}) error + Update func(v interface{}) error + func New(instance interface{}, options *Options) Model + func NewModel(opts ...Option) Model + type Option func(*Options) + func WithContext(ctx context.Context) Option + func WithDatabase(db string) Option + func WithDebug(d bool) Option + func WithIndexes(idx ...Index) Option + func WithKey(idField string) Option + func WithNamespace(ns string) Option + func WithStore(s store.Store) Option + func WithTable(t string) Option + type Options struct + Context context.Context + Database string + Debug bool + Indexes []Index + Key string + Namespace string + Store store.Store + Table string + type Order struct + FieldName string + Type OrderType + type OrderType string + type Query struct + Limit int64 + Offset int64 + Order Order + Value interface{} + func QueryAll() Query + func QueryByID(id string) Query + func QueryEquals(fieldName string, value interface{}) Query