Versions in this module Expand all Collapse all v3 v3.1.0 Dec 22, 2022 Changes in this version + type InArray struct + func NewInArray(key string, value any) *InArray + func (l *InArray) Key() string + func (l *InArray) Left() Filter + func (l *InArray) Right() Filter + func (l *InArray) Value() any + type NotEquals struct + func NewNotEquals(key string, value any) *NotEquals + func (l *NotEquals) Key() string + func (l *NotEquals) Left() Filter + func (l *NotEquals) Right() Filter + func (l *NotEquals) Value() any + type NotInArray struct + func NewNotInArray(key string, value any) *NotInArray + func (l *NotInArray) Key() string + func (l *NotInArray) Left() Filter + func (l *NotInArray) Right() Filter + func (l *NotInArray) Value() any v3.0.1 Dec 20, 2022 v3.0.0 Dec 19, 2022 Changes in this version + var OperationAny = []Operation + type And struct + func NewAnd(left Filter, right Filter) *And + func (l *And) Key() string + func (l *And) Left() Filter + func (l *And) Right() Filter + func (l *And) Value() any + type Collection struct + Database *Database + Name string + func NewCollection(database *Database, name string) *Collection + type Config interface + GetContext func(ctx context.Context) (context.Context, context.CancelFunc) + type Create struct + Data []T + func NewCreate(creator Creator[T]) *Create[T] + func (c *Create[T]) Commit(ctx context.Context) error + func (c *Create[T]) With(data ...T) *Create[T] + type Creator interface + ExecuteCreate func(ctx context.Context, create *Create[T]) error + type Database struct + Name string + func NewDatabase(name string) *Database + type Delete struct + Filters []Filter + func NewDelete(deleter Deleter[T]) *Delete[T] + func (d *Delete[T]) Commit(ctx context.Context) (int, error) + func (d *Delete[T]) Where(filter Filter) *Delete[T] + type Deleter interface + ExecuteDelete func(ctx context.Context, delete *Delete[T]) (int, error) + type Equals struct + func NewEquals(key string, value any) *Equals + func (l *Equals) Key() string + func (l *Equals) Left() Filter + func (l *Equals) Right() Filter + func (l *Equals) Value() any + type Event struct + Data T + Operation Operation + type Exists struct + func NewExists(value any) *Exists + func (l *Exists) Key() string + func (l *Exists) Left() Filter + func (l *Exists) Right() Filter + func (l *Exists) Value() any + type Field struct + Key string + Type FieldType + func NewField(key string) *Field + func (f *Field) OfTypeSort(order *Order) *Field + func (f *Field) OfTypeText() *Field + type FieldType int + const FieldTypeAscending + const FieldTypeDescending + const FieldTypeString + func (t FieldType) String() string + type Filter interface + Key func() string + Left func() Filter + Right func() Filter + Value func() any + type GreaterThan struct + func NewGreaterThan(key string, value any) *GreaterThan + func (l *GreaterThan) Key() string + func (l *GreaterThan) Left() Filter + func (l *GreaterThan) Right() Filter + func (l *GreaterThan) Value() any + type GreaterThanOrEqual struct + func NewGreaterThanOrEqual(key string, value any) *GreaterThanOrEqual + func (l *GreaterThanOrEqual) Key() string + func (l *GreaterThanOrEqual) Left() Filter + func (l *GreaterThanOrEqual) Right() Filter + func (l *GreaterThanOrEqual) Value() any + type Index struct + Fields []*Field + IsUnique bool + Name string + func NewIndex(name ...string) *Index + func (i *Index) AddField(field ...*Field) *Index + func (i *Index) Unique() *Index + type LessThan struct + func NewLessThan(key string, value any) *LessThan + func (l *LessThan) Key() string + func (l *LessThan) Left() Filter + func (l *LessThan) Right() Filter + func (l *LessThan) Value() any + type LessThanOrEqual struct + func NewLessThanOrEqual(key string, value any) *LessThanOrEqual + func (l *LessThanOrEqual) Key() string + func (l *LessThanOrEqual) Left() Filter + func (l *LessThanOrEqual) Right() Filter + func (l *LessThanOrEqual) Value() any + type Operation int + const OperationCreate + const OperationDelete + const OperationUpdate + func (o Operation) String() string + type Or struct + func NewOr(left Filter, right Filter) *Or + func (l *Or) Key() string + func (l *Or) Left() Filter + func (l *Or) Right() Filter + func (l *Or) Value() any + type Order struct + IsAscending bool + func NewAscendingOrder() *Order + func NewDescendingOrder() *Order + type Querier interface + ExecuteQuery func(ctx context.Context, query *Query[T]) (<-chan T, error) + type Query struct + Filters []Filter + Range *Range + Sorting map[string]*Order + func NewQuery(querier Querier[T]) *Query[T] + func (q *Query[T]) All(ctx context.Context) ([]T, error) + func (q *Query[T]) Channel(ctx context.Context) (<-chan T, error) + func (q *Query[T]) In(rng *Range) *Query[T] + func (q *Query[T]) Single(ctx context.Context) (T, error) + func (q *Query[T]) Sort(key string, order ...*Order) *Query[T] + func (q *Query[T]) Where(filter Filter) *Query[T] + type Range struct + SkipValue int + TakeValue int + func NewRange() *Range + func (r *Range) Skip(skip int) *Range + func (r *Range) Take(take int) *Range + type Regex struct + func NewRegex(key string, value any) *Regex + func (l *Regex) Key() string + func (l *Regex) Left() Filter + func (l *Regex) Right() Filter + func (l *Regex) Value() any + type Transaction struct + func NewTransaction(transactor Transactor) *Transaction + func (t *Transaction) Run(ctx context.Context, fn TransactionFn) error + type TransactionFn func(ctx context.Context) error + type Transactor interface + ExecuteTransaction func(ctx context.Context, fn TransactionFn) error + type Update struct + Data T + Filters []Filter + ShouldUpsert bool + func NewUpdate(updater Updater[T]) *Update[T] + func (u *Update[T]) Commit(ctx context.Context) error + func (u *Update[T]) Upsert() *Update[T] + func (u *Update[T]) Where(filter Filter) *Update[T] + func (u *Update[T]) With(data T) *Update[T] + type Updater interface + ExecuteUpdate func(ctx context.Context, update *Update[T]) error + type Watch struct + Operations []Operation + func NewWatch(watcher Watcher[T]) *Watch[T] + func (w *Watch[T]) Channel(ctx context.Context) (<-chan *Event[T], error) + func (w *Watch[T]) Handle(ctx context.Context, handler WatchHandler[T]) error + func (w *Watch[T]) On(operation ...Operation) *Watch[T] + type WatchHandler func(ctx context.Context, event *Event[T]) + type Watcher interface + ExecuteWatch func(ctx context.Context, watch *Watch[T]) (<-chan *Event[T], error) Other modules containing this package github.com/Becklyn/clerk github.com/Becklyn/clerk/v2 github.com/Becklyn/clerk/v4