Versions in this module Expand all Collapse all v0 v0.1.0 Oct 20, 2026 Changes in this version + var ErrAlreadyExists = errors.New("yuruidb: record already exists") + var ErrClosed = errors.New("yuruidb: store closed") + var ErrConflict = errors.New("yuruidb: revision conflict") + var ErrInvalid = errors.New("yuruidb: invalid argument") + var ErrNotFound = errors.New("yuruidb: record not found") + var ErrOutcomeUnknown = errors.New("yuruidb: mutation outcome unknown") + var ErrUnsupported = errors.New("yuruidb: unsupported capability") + func DecodeConfig[T any](input any) (T, error) + func Drivers() []string + func NewID() (string, error) + func NewRevision() (string, error) + func OutcomeUnknown(cause error) error + func Register(name string, factory Factory) + func ValidateCollection(name string) error + func ValidateID(id string) error + type Capabilities struct + ConditionalMutations bool + Distributed bool + StrongReads bool + type CollectionOpener interface + OpenCollection func(context.Context, string) (RawStore, error) + type Config map[string]any + type Factory func(context.Context, any) (RawStore, error) + type ListOptions struct + Cursor string + Limit int + type MutationError struct + AttemptedRevision string + Cause error + Collection string + ExpectedRevision string + ID string + Nonce string + Operation string + func (e *MutationError) Error() string + func (e *MutationError) MatchesRevision(value string) bool + func (e *MutationError) Unwrap() error + type Page struct + Cursor string + Records []Record[T] + type RawPage struct + Cursor string + Records []RawRecord + type RawRecord struct + ID string + Revision string + Value []byte + type RawStore interface + Capabilities func() Capabilities + Close func() error + Delete func(context.Context, string, string) error + Get func(context.Context, string) (RawRecord, error) + Insert func(context.Context, string, []byte) (RawRecord, error) + List func(context.Context, ListOptions) (RawPage, error) + Update func(context.Context, string, []byte, string) (RawRecord, error) + func OpenRaw(ctx context.Context, name string, options any) (RawStore, error) + type Record struct + Data T + func (r *Record[T]) UnmarshalJSON(data []byte) error + func (r Record[T]) ID() string + func (r Record[T]) MarshalJSON() ([]byte, error) + func (r Record[T]) Revision() string + type Store struct + func Open(ctx context.Context, name string, options any) (*Store, error) + func Wrap(raw RawStore) *Store + func (s *Store) Backup(ctx context.Context, w io.Writer) error + func (s *Store) Bind[T any](collection string) error + func (s *Store) Capabilities() Capabilities + func (s *Store) Close() error + func (s *Store) Delete[T any](ctx context.Context, id, revision string) error + func (s *Store) Get[T any](ctx context.Context, id string) (Record[T], error) + func (s *Store) Insert[T any](ctx context.Context, id string, data T) (Record[T], error) + func (s *Store) List[T any](ctx context.Context, options ListOptions) (Page[T], error) + func (s *Store) PurgeTombstones[T any](ctx context.Context) (int, error) + func (s *Store) Remove[T any](ctx context.Context, id string) error + func (s *Store) Set[T any](ctx context.Context, id string, data T) (Record[T], error) + func (s *Store) Update[T any](ctx context.Context, id string, data T, revision string) (Record[T], error)