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
| Parameter | Type | Default | Description |
|---|---|---|---|
path | Str | :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
- Sourcing::Plugin::EventStore — the abstract interface
- Sourcing::Plugin::EventStore::Memory — in-memory implementation
- Sourcing::Plugin::Memory — combined backward-compatible implementation
- Writing a Plugin Guide — how to implement your own plugin