eventium-sqlite: SQLite implementations for eventium

[ database, eventsourcing, library, mit, sqlite ] [ Propose Tags ] [ Report a vulnerability ]

Eventium-sqlite provides a SQLite-based event store implementation for the Eventium event sourcing framework. It uses the Persistent library for type-safe database access and provides efficient event storage and retrieval with support for aggregate streams, event versioning, and optimistic concurrency control. This backend is ideal for single-process applications, embedded systems, and scenarios where a lightweight database is preferred.


[Skip to Readme]

Modules

[Last Documentation]

  • Eventium
    • ProjectionCache
      • Eventium.ProjectionCache.Sqlite
    • Store
      • Eventium.Store.Sqlite

Flags

Manual Flags

NameDescriptionDefault
ci

Enable -Werror for CI builds

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.2.1
Change log CHANGELOG.md
Dependencies aeson (>=1.5 && <2.3), base (>=4.9 && <5), bytestring (>=0.10 && <0.13), eventium-core (>=0.2.0 && <0.3.0), eventium-sql-common (>=0.2.0 && <0.3.0), mtl (>=2.2 && <2.4), persistent (>=2.14 && <2.18), text (>=1.2 && <2.2), uuid (>=1.3 && <1.4) [details]
License MIT
Author
Maintainer Alexander Sidorenko
Uploaded by aleks_sidorenko at 2026-03-06T14:29:21Z
Category Database, Eventsourcing, SQLite
Home page https://github.com/aleks-sidorenko/eventium#readme
Bug tracker https://github.com/aleks-sidorenko/eventium/issues
Source repo head: git clone https://github.com/aleks-sidorenko/eventium
Distributions
Downloads 11 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-03-06 [all 2 reports]

Readme for eventium-sqlite-0.2.1

[back to package description]

Eventium SQLite

SQLite event store backend for Eventium.

Overview

eventium-sqlite provides a lightweight, file-based event store using SQLite. Ideal for CLI tools, single-process applications, and development environments where a full database server is unnecessary.

API

sqliteEventStoreWriter
  :: (MonadIO m)
  => SqlEventStoreConfig entity serialized
  -> VersionedEventStoreWriter (SqlPersistT m) serialized

initializeSqliteEventStore
  :: (MonadIO m)
  => SqlEventStoreConfig entity serialized
  -> ConnectionPool
  -> m ()

Readers come from eventium-sql-common (re-exported):

sqlEventStoreReader       :: SqlEventStoreConfig entity serialized -> VersionedEventStoreReader (SqlPersistT m) serialized
sqlGlobalEventStoreReader :: SqlEventStoreConfig entity serialized -> GlobalEventStoreReader (SqlPersistT m) serialized

Usage

import Eventium.Store.Sqlite
import Database.Persist.Sqlite

main :: IO ()
main = runNoLoggingT $ do
  pool <- createSqlitePool "events.db" 1
  liftIO $ initializeSqliteEventStore defaultSqlEventStoreConfig pool

  let writer = sqliteEventStoreWriter defaultSqlEventStoreConfig
      reader = sqlEventStoreReader defaultSqlEventStoreConfig
  -- writer and reader operate in SqlPersistT m

initializeSqliteEventStore runs migrations and creates a UUID index.

When to Use

Scenario Recommendation
CLI tools, desktop apps SQLite
Development / prototyping SQLite or Memory
Multi-process / production PostgreSQL
Unit tests (no persistence needed) Memory

Installation

dependencies:
  - eventium-core
  - eventium-sqlite
  - persistent-sqlite

Documentation

License

MIT -- see LICENSE.md