Sourcing::Plugin::EventStore::SQLite

SQLite-based implementation of the EventStore interface for persistent event storage.

Overview

This class implements Sourcing::Plugin::EventStore using SQLite for persistent storage. Events are stored in a SQLite database and can survive process restarts.

When to use: Production deployments requiring persistent event storage.

Usage

use Sourcing::Plugin::EventStore::SQLite;

# File-based SQLite (persists between runs)
my $store = Sourcing::Plugin::EventStore::SQLite.new: :path;
$store.use;

# Use with Sourcing
my $projection = sourcing MyProjection, :id($some-id);

Configuration

ParameterTypeDefaultDescription
pathStr:memory:Path to SQLite database file

Database Schema

CREATE TABLE events (
    id INTEGER PRIMARY KEY,
    type TEXT NOT NULL,
    ids TEXT NOT NULL,
    data TEXT NOT NULL,
    timestamp TEXT NOT NULL
);
CREATE INDEX idx_type_ids ON events(type, ids);

See Also