memory

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package memory implements every flexitype repository port in process memory: no database, no migrations. It powers the browser playground and gives embedding consumers a zero-dependency test double with the same semantics as the PostgreSQL implementation (soft archiving, hierarchies, pagination, FQL). Writes apply to the shared maps immediately, but the memory transactor honours the commit-hook contract (activity, events) AND keeps a per-transaction undo journal, so a rollback reverses exactly the keys that transaction wrote — leaving a concurrently interleaved transaction's committed writes intact, matching PostgreSQL atomicity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeSetEraserFor added in v1.3.0

func ChangeSetEraserFor(s changeset.Store) erasure.ResidualEraser

ChangeSetEraserFor exposes the residual eraser for a store built by NewChangeSetStore, whose concrete type is unexported.

func NewChangeSetStore

func NewChangeSetStore() changeset.Store

NewChangeSetStore builds an in-memory change-set store.

func NewMatchStore

func NewMatchStore() dedup.Store

NewMatchStore builds an in-memory matching-rule store.

func NewRevisionStore

func NewRevisionStore() revision.Store

NewRevisionStore builds an in-memory entity-revision store.

func NewSavedViewStore

func NewSavedViewStore() savedview.Store

NewSavedViewStore builds an in-memory saved-view store.

func NewUnitFamilyStore

func NewUnitFamilyStore() unit.Store

NewUnitFamilyStore builds an in-memory unit-family store.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the shared in-memory state every repository views.

func NewStore

func NewStore() *Store

NewStore creates an empty in-memory store.

func (*Store) ActivityLog

func (s *Store) ActivityLog() activity.Log

ActivityLog returns the in-memory audit log.

func (*Store) NewActivityEraser added in v1.3.0

func (s *Store) NewActivityEraser() erasure.ResidualEraser

NewActivityEraser builds the in-memory audit-log residual eraser.

func (*Store) Repositories

func (s *Store) Repositories() application.Repositories

Repositories returns the full repository set over this store, including the in-process FQL executor.

func (*Store) SearchStore

func (s *Store) SearchStore() search.DocumentStore

SearchStore returns the in-memory search projection store.

func (*Store) Transactor

func (s *Store) Transactor() db.Transactor

Transactor returns a transactor honouring the pre/post/rollback hook contract. On rollback it replays the transaction's undo journal — restoring exactly the keys that transaction wrote — so a unit of work that writes then fails leaves no partial data (matching PostgreSQL's atomicity) WITHOUT disturbing the writes any other in-flight transaction has committed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL