eventium-sqlite: SQLite implementations for eventium

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

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]

Properties

Versions 0.1.0, 0.2.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
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
Uploaded by aleks_sidorenko at 2026-03-05T10:40:53Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for eventium-sqlite-0.2.0

[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