0.31.0
🚀 What's New
- Added the first version of PostgreSQL async projections by @oskardudycz in #197
Projections are defined the same way as inline ones (see more in the article).
The easiest way to use it is to:
const eventStore = getPostgreSQLEventStore(connectionString);
const consumer = eventStore.consumer();
consumer.processor({projection: someProjection });
consumer.processor({projection: otherProjection});
await consumer.start()
You can also run it explicitly:
const consumer = postgreSQLEventStoreConsumer({
connectionString,
});
consumer.processor({projection: someProjection });
consumer.processor({projection: otherProjection});
await consumer.start()
or
const consumer = postgreSQLEventStoreConsumer({
connectionString,
processors: [
postgreSQLProcessor({ projection: someProjection}),
postgreSQLProcessor({ projection: otherProjection }),
],
});
await consumer.start();
I'm also considering, in the further releases, making them automatically registered as:
const eventStore = getPostgreSQLEventStore({
connectionString,
projections: projections.async([someProjection, otherProjection]),
});
// consumer will get async projections registered as processors
const consumer = eventStore.consumer();
await consumer.start()
📚 Docs
New Contributors
Full Changelog: 0.30.0...0.31.0