Versions in this module Expand all Collapse all v1 v1.0.1 Apr 1, 2024 Changes in this version + type Collection struct + DB DB + Indices []Index[T, any] + Name string + func OpenCollection[T any](db DB, name string) (Collection[T], error) + func (t *Collection[T]) Delete(query Query[T]) error + func (t *Collection[T]) Insert(data T) error + func (t *Collection[T]) Modify(query Query[T], updater Updater[T]) error + func (t *Collection[T]) Number() (int, error) + func (t *Collection[T]) Select(query Query[T]) ([]T, error) + type CollectionMetadata struct + LastID int + type DB struct + Path string + func OpenDB(path string) (DB, error) + func (t *DB) CollectionExists(name string) (bool, error) + func (t *DB) DeleteCollection(name string) error + func (t *DB) ListCollections() ([]string, error) + type Index struct + Collection *Collection[T] + Extractor func(T) D + Index map[D][]string + func OpenIndex[T any, D comparable](c *Collection[T], extractor func(T) D) (Index[T, any], error) + func (t *Index[T, D]) Del(key D) error + func (t *Index[T, D]) Get(key D) ([]T, error) + func (t *Index[T, D]) Mod(key D, updater Updater[T]) error + func (t *Index[T, D]) Num(key D) (int, error) + type Query func(T) bool + type Updater func(T) T v1.0.0 Apr 1, 2024