-
Notifications
You must be signed in to change notification settings - Fork 0
Connecting to PostgreSQL
Ahmed edited this page Mar 16, 2026
·
2 revisions
To connect EventLens to your PostgreSQL event store, configure the datasource block in your eventlens.yaml.
datasource:
url: jdbc:postgresql://localhost:5432/eventlens_dev
username: eventlens_ro
password: strong_password_here
table: eventlens_events # Your materialized view mappingEventLens runs read-only queries. To ensure timelines and bisects are fast, index your underlying event table correctly:
-- Lookup all events for a single aggregate, in order
CREATE INDEX IF NOT EXISTS idx_domain_events_agg_seq
ON domain_events (aggregate_type, aggregate_id, sequence);
-- Time-based queries / live windows
CREATE INDEX IF NOT EXISTS idx_domain_events_occurred_at
ON domain_events (occurred_at);If you frequently filter by JSON properties, consider functional indexes:
CREATE INDEX IF NOT EXISTS idx_domain_events_status
ON domain_events ((payload->>'status'));