Skip to content

Added an option to plug multiple database drivers to SQLite event store (yes, also Cloudflare D1) - #296

Merged
oskardudycz merged 12 commits into
mainfrom
add_event_store_driver
Feb 7, 2026
Merged

Added an option to plug multiple database drivers to SQLite event store (yes, also Cloudflare D1)#296
oskardudycz merged 12 commits into
mainfrom
add_event_store_driver

Conversation

@oskardudycz

@oskardudycz oskardudycz commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

This is the first version that allows running both sqlite3 and Cloudflare D1 event store. (At least on Miniflare).

After this PR, it'll be needed to add drivers to the event store config, e.g.:

For sqlite3:

import { getSQLiteEventStore } from '@event-driven-io/emmett-sqlite';
import { sqlite3EventStoreDriver} from '@event-driven-io/emmett-sqlite/sqlite3';

const eventStore = getSQLiteEventStore({
      driver: sqlite3EventStoreDriver,
      fileName,
});

For Cloudflare D1

import { getSQLiteEventStore } from '@event-driven-io/emmett-sqlite';
import { d1EventStoreDriver} from '@event-driven-io/emmett-sqlite/cloudflare';

const eventStore = getSQLiteEventStore({
      driver: d1EventStoreDriver,
      database,
});

Also, in this PR, I implemented batching for SQLite appends to make it work also for Cloudflare D1.

There'll be follow-up PRs adjusting consumers and processors to base code according to PostgreSQL. Also extending drivers to have better DX and not take flattened Dumbo pool options. And adding Pongo support of course.

@SamHatoum @LuccaHellriegel @davecosec FYI.

@oskardudycz
oskardudycz force-pushed the add_event_store_driver branch from fa373e1 to 94ed34f Compare February 7, 2026 17:53
@oskardudycz
oskardudycz marked this pull request as ready for review February 7, 2026 18:39
@oskardudycz
oskardudycz merged commit d24d2e8 into main Feb 7, 2026
6 checks passed
@oskardudycz
oskardudycz deleted the add_event_store_driver branch February 7, 2026 18:40
@oskardudycz oskardudycz added this to the 0.43.0 milestone Feb 7, 2026
@oskardudycz oskardudycz changed the title Added an option to plug multiple database drivers to SQLite event store Added an option to plug multiple database drivers to SQLite event store (yes, also Cloudflare D1) Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant