@bimetal/store-eventstoredb
v0.9.0
Published
EventStoreDB-backed EventStore implementation for @bimetal/data — native event sourcing
Maintainers
Readme
@bimetal/store-eventstoredb
EventStoreDB-backed EventStore for @bimetal/data. Native event sourcing.
Installation
npm install @bimetal/store-eventstoredbUsage
import { createEsdbEventStore } from '@bimetal/store-eventstoredb';
import { createCalendarStore } from '@bimetal/data';
const eventStore = createEsdbEventStore({
connectionString: 'esdb://localhost:2113?tls=false',
});
const store = createCalendarStore({ eventStore });
await store.hydrate();Testing
Integration tests require a running EventStoreDB instance:
# Start EventStoreDB
docker run -d --name esdb -p 2113:2113 eventstore/eventstore:latest --insecure
# Run tests
npm test --workspace @bimetal/store-eventstoredb
# Or set custom URL
EVENTSTOREDB_URL=esdb://custom-host:2113?tls=false npm testTests are skipped automatically when EventStoreDB is not reachable.
CI Setup
Add to your CI pipeline:
services:
eventstoredb:
image: eventstore/eventstore:latest
ports: ['2113:2113']
options: --insecure
env:
EVENTSTOREDB_URL: esdb://localhost:2113?tls=false