API Reference Fact v#0.3.1
View SourceModules
Fact is an event-sourcing database, an append-only event store designed to make event-driven systems explicit, observable, and mechanically simple.
This module encapsulates the adapters used for working with the bootstrap record file.
The context for a bootstrapping the Fact database.
Adapter for decoding the contents of the bootstrap file.
Adapter for encoding the contents of the bootstrap file.
Adapter for naming the bootstrap file.
Adapter for reading the bootstrap file.
Adapter for writing the bootstrap file.
Boots a Fact database from disk.
Compile-time build metadata for the project.
Behaviour and helper implementation for catch-up subscriptions.
Catch-up subscription for the all stream.
Catch-up subscription for a single index value.
Catch-up subscription for event queries.
Catch-up subscription for a single event stream.
This exception is raised when the optimistic concurrency control logic determines an event or events cannot be written to the ledger.
The context for a Fact database.
Represents a running Fact database instance and orchestrates indexing, event tracking, and record publishing.
Supervises all processes for a single Fact database instance.
Domain-specific module that encapsulates configurable adapters for event-related operations.
Adapter for working with configurable event id implementations.
Adapter for working with configurable event schema implementations.
Indexes events by the values of a specified field within event data.
Base behaviour and macro for building event indexers.
This is the Judge Judy of the system, it manages the event ledger for a Fact database instance, handling all commits, enforcing optimistic concurrency control via append conditions.
The central hub for broadcasting events within a Fact database.
Indexes events by the category portion of an event stream, by splitting the string on a specified separator and returns the first segment.
Index events by their event stream if specified.
A per-stream, on-demand GenServer responsible for serializing writes to an event stream. It ensures that events are appended in order, enriched with stream metadata, and committed atomically.
Indexes the first event of each event stream by the stream category.
An event indexer which indexes the first event of each event stream.
Indexs events by each of their specified tags.
Index events by their event type.
Command representing the creation of a new Fact database.
Decides which events should be produced in response to Genesis commands.
Event representing the creation of a new Fact database.
The divine module that brings a Fact database into existence.
Domain-specific module that encapsulates configurable adapters for working with index checkpoint files.
Adapter for decoding the contents of index checkpoint files.
Adapter for encoding the contents of index checkpoint files.
Adapter for naming the index checkpoint files within the file system.
Adapter for reading the contents of index checkpoint files.
Adapter for writing the contents of index checkpoint files to the file system.
Domain-specific module that encapsulates configurable adapters for working with index files.
Adapter for decoding the contents of index files.
Adapter for encoding the contents of index files.
Adapter for naming the index files within the file system.
Adapter for reading the contents of index files.
Adapter for writing the contents of index files to the file system.
Domain-specific module that encapsulates configurable adapters for working with ledger file.
Adapter for decoding the contents of ledger file.
Adapter for encoding the contents of ledger file.
Adapter for naming the ledger file within the file system.
Adapter for reading the contents of the ledger file.
Adapter for writing the contents of ledger file to the file system.
Provides a cross-VM exclusive lock for Fact database instances.
Domain-specific module that encapsulates configurable adapters for working with lock files.
Adapter for decoding the contents of lock file.
Adapter for encoding the contents of lock file.
Adapter for naming the lock file within the file system.
Adapter for reading the contents of the lock file.
Adapter for writing the contents of the lock file to the file system.
A Merkle Mountain Range (MMR) for cryptographic verification of event history integrity.
Provide utilities for constructing event queries for defining consistency boundaries and projection sources.
Provides functions for constructing query item structures and converting them into query functions.
An in-memory LFU (Least Frequently Used) cache for decoded event records.
Domain-specific module that encapsulates configurable adapters for working with event record files.
Adapter for decoding the contents of event record files.
Adapter for encoding the contents of event record files.
Adapter for naming the event records files within the file system.
Adapter for reading the contents of the event record files.
Adapter for writing the contents of the lock file to the file system.
Registry utilities for process discovery and naming within the Fact system.
This module is the foundation for building flexible, versioned, and configurable components throughout the Fact system, providing consistency and reducing boilerplate.
Base behaviour module providing the "glue" between a specific Seam and its implementations.
Behaviour defining how to decode stored records back into Elixir terms.
Meta module providing an adapter for dispatching to decoder implementations.
A decoder for delimited content.
A decoder for integers.
A JSON decoder implementation.
A raw decoder implementation that returns the binary value as-is.
Registry of available decoder implementations.
Behaviour defining how to encode records before they are written to storage.
Meta module that provides an adapter for calling Fact.Seam.Encoder implementations.
Delimited encoder implementation for event records.
Integer encoder implementation for event records.
JSON encoder implementation for event records.
Standard raw encoder implementation that passes binary content through unchanged.
Registry of all available Fact.Seam.Encoder implementations.
Behaviour defining how to generate event ids for events in a Fact database.
Meta module providing an adapter for Fact.Seam.EventId implementations.
Registry for Fact.Seam.EventId implementations.
Fact.Seam.EventId implementation that generates UUID v4 identifiers.
Behaviour defining how to retrieve the event schema for a Fact database.
Meta module providing an adapter for Fact.Seam.EventSchema.
An EventSchema similar to the schema used in the Emmett NodeJs library.
An EventSchema similar to the schema used in the KurrentDB .NET client.
An EventSchema similar to the schema used in the MartenDB .NET client.
Registry of available Fact.Seam.EventSchema implementations.
Standard Fact.Seam.EventSchema implementation.
Behaviour defining the contract for generating file names within the Fact system.
Meta module providing a Fact.Seam.Adapter for file name generation.
A file name implementation that derives the file name from the event_id of a given event.
A file name implementation that returns a fixed, preconfigured name.
A file name implementation that generates a deterministic hashed name.
A raw file name implementation that returns the input value unchanged.
Registry for all Fact.Seam.FileName implementations.
Behaviour defining the contract for reading files within the Fact system.
Meta module providing a Fact.Seam.Adapter for Fact.Seam.FileReader implementations.
A Fact.Seam.FileReader implementation for fixed-length records.
A Fact.Seam.FileReader implementation that reads the entire file content at once.
Registry for all Fact.Seam.FileReader implementations.
Behaviour defining the contract for writing files within the Fact system.
Meta module providing the adapter interface for Fact.Seam.FileWriter.
Registry of all configured Fact.Seam.FileWriter implementations.
Standard V1 implementation of Fact.Seam.FileWriter.
Represents a specific configured instance of a Fact.Seam component.
Provides a registry for all implementations of a configurable Fact.Seam component. 📚
Behaviour defining the storage configuration for a Fact database.
Meta module providing an adapter for accessing storage-related functionality
via a Fact.Seam.Storage implementation.
Registry for Fact.Seam.Storage implementations.
Standard V1 implementation of the Fact.Seam.Storage seam.
Standard V2 implementation of the Fact.Seam.Storage seam.
Adapter for working with configurable storage implementations.
Top-level supervisor for the Fact database system.
A segmented, append-only write-ahead log for durability and crash recovery.
Represents a WAL entry. Serialized using :erlang.term_to_binary.
Mix Tasks
Backs up the contents of a Fact database.
Creates a new database.
Creates an inclusion proof for an event at a given ledger position.
Prints the current MMR peak hashes for a database.
Verifies the integrity of a database's Merkle Mountain Range.
Verifies an MMR inclusion proof from a JSON file.
Restores a Fact database from a backup ZIP created by mix fact.backup.