Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: In memory database handle #206

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
38dc3b9
Added basic inMemoryDatabase
stepaniukm Feb 10, 2025
250dc59
Merge branch 'main' of github.com:stepaniukm/emmett into in-memory-in…
stepaniukm Feb 10, 2025
bfd9927
removed DocumentHandler type that will be a part of future efforts
stepaniukm Feb 11, 2025
9f755fd
Added optional getDocumentId selector for single stream projection
oskardudycz Feb 11, 2025
4547680
Exposed InMemory Database and removed redundant DocumentHandler
oskardudycz Feb 11, 2025
9bebf8f
Added eventstore the ability to create connection from path
Jan 20, 2025
ec0193e
Swapped creation of event store to be purely done internally
Feb 2, 2025
670313f
Added check for created database
Feb 2, 2025
469e51a
Use in memory for sqlite connection in test
Feb 2, 2025
827e6c4
Removed sqlite connection location being optional
Feb 8, 2025
0e16b44
Removed redundant option
Feb 8, 2025
5ada72d
Wrapped event store actions with try catches and connection handling
Feb 8, 2025
16b5908
Removed redundant finally clause
Feb 8, 2025
e060d86
Moved ensure created inside try catch block
Feb 10, 2025
1d7fdff
Fixed failing SQLite e2e tests and TS config
oskardudycz Feb 11, 2025
a18d735
Bumped to 0.27.0
oskardudycz Feb 11, 2025
52c64fd
add support for async deciders in the decider specification, fix typo
alex-laycalvert Feb 11, 2025
a19fba4
Bumped to 0.28.0
oskardudycz Feb 12, 2025
e27b48a
Added first draft of EventStoreDB consumer
oskardudycz Feb 11, 2025
df161d7
Added support for subscribing to stream for ESDB Consumer
oskardudycz Feb 13, 2025
2b12e22
Renamed ESDB subscriptions to processors
oskardudycz Feb 13, 2025
f69df1a
Renamed PostgreSQL consumer to processor
oskardudycz Feb 13, 2025
7f993c8
Enabled PostgreSQL consumer tests that were not run by accidentally m…
oskardudycz Feb 13, 2025
cea0df6
Added default event type to consumers
oskardudycz Feb 14, 2025
6e21c8a
Added deadlines for consumer tests in case of transient issue
oskardudycz Feb 14, 2025
b13e6fd
Added possibility to create consumers from directly from event stores
oskardudycz Feb 14, 2025
9412ef6
Bumped to 0.29.0
oskardudycz Feb 14, 2025
3836f92
Made consumer options really optional when creating it from event stores
oskardudycz Feb 14, 2025
88c8803
Bumped to 0.30.0
oskardudycz Feb 14, 2025
94a5c2c
Updated samples to 0.30.0 version
oskardudycz Feb 14, 2025
ec24034
Add API reference link to documentation sidebar and update title in A…
tburny Feb 24, 2025
639dbdf
Removed redundant typing for Event Metadata in PostgreSQL projection
oskardudycz Feb 21, 2025
60df725
Aligned PostgreSQL processor and projection handler context
oskardudycz Feb 21, 2025
5c47e58
Added projection processor factory in consumer
oskardudycz Feb 21, 2025
a642c4f
Unified PostgreSQL processor setup to take also projeciton definition…
oskardudycz Feb 24, 2025
7776cb2
Adjusted projection definition
oskardudycz Feb 24, 2025
2b982bc
Unified ProjectionDefinition and TypedProjectionDefinition into one
oskardudycz Feb 25, 2025
d378178
Made connection string and pool optional in PostgreSQL context and al…
oskardudycz Feb 26, 2025
3db0b25
Bumped to 0.31.0
oskardudycz Feb 27, 2025
d2b6dbc
Added message type to allow store not only events but also commands
oskardudycz Feb 8, 2025
7767d05
Renamed events to messages in the PostgreSQL and SQLite schemas and a…
oskardudycz Feb 8, 2025
f81a80e
Updated PostgreSQL appendToStream function to store message kind
oskardudycz Feb 11, 2025
b8bfba2
Made message_kind column to be char(1) instead of Text
oskardudycz Feb 27, 2025
1e8740a
Refactored SQLite AppendToStream to use messages instead of events
oskardudycz Feb 27, 2025
ffc5957
Bumped to 0.32.0-alpha.1
oskardudycz Feb 28, 2025
8c7ed54
Bumped to 0.32.0
oskardudycz Feb 28, 2025
9fd226d
chore: add max for discounts
shraddha38 Feb 26, 2025
5ab9a17
chore: minor refactor
shraddha38 Feb 27, 2025
880a332
Add overview page to documentation
tburny Feb 24, 2025
765611e
Fix typos and correct command handler documentation
tburny Feb 27, 2025
cabdb4e
Spell Emmett correctly and add further reading section
tburny Feb 27, 2025
2e042b9
Add linkts to Emmett Discord and the Further Reading section
tburny Feb 27, 2025
4cb0f4e
Main documentation areas should be accessible from navigation bar
tburny Feb 27, 2025
30c9cd8
Fix typo in link to api reference
tburny Feb 27, 2025
c2893de
Exported the missing SQLite package code
oskardudycz Mar 1, 2025
db95886
Bumped to 0.33.0
oskardudycz Mar 1, 2025
5565dda
Added the first version of SQLite projections and exposed onBeforeCom…
oskardudycz Mar 1, 2025
cfc0785
Bumped to 0.34.0
oskardudycz Mar 1, 2025
c95bddc
add first iteration of inMemoryDatabase with handle possibilities
stepaniukm Mar 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,6 @@ lib
*/.output
e2e/esmCompatibility/.output
src/e2e/esmCompatibility/.output
**/0x
**/0x

**/*.db
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Check also my blog articles on Emmett:
- [Testing Event Sourcing, Emmett edition](https://event-driven.io/en/testing_event_sourcing_emmett_edition/)
- [Event Sourcing on PostgreSQL in Node.js just became possible with Emmett](https://event-driven.io/en/emmett_postgresql_event_store/)
- [Writing and testing event-driven projections with Emmett, Pongo and PostgreSQL](https://event-driven.io/en/emmett_projections_testing/)
- [Using event metadata in event-driven projections](https://event-driven.io/en/projections_and_event_metadata/)=
- [Using event metadata in event-driven projections](https://event-driven.io/en/projections_and_event_metadata/)

## FAQ

Expand Down
38 changes: 19 additions & 19 deletions samples/webApi/expressjs-with-esdb/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions samples/webApi/expressjs-with-esdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
},
"homepage": "https://github.com/event-driven-io/emmett#readme",
"dependencies": {
"@event-driven-io/emmett": "0.23.0-alpha.12",
"@event-driven-io/emmett-esdb": "0.23.0-alpha.12",
"@event-driven-io/emmett-expressjs": "0.23.0-alpha.12",
"@event-driven-io/emmett-testcontainers": "0.23.0-alpha.12"
"@event-driven-io/emmett": "0.30.0",
"@event-driven-io/emmett-esdb": "0.30.0",
"@event-driven-io/emmett-expressjs": "0.30.0",
"@event-driven-io/emmett-testcontainers": "0.30.0"
},
"devDependencies": {
"@types/node": "20.11.30",
Expand Down
28 changes: 14 additions & 14 deletions samples/webApi/expressjs-with-mongodb/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions samples/webApi/expressjs-with-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
},
"homepage": "https://github.com/event-driven-io/emmett#readme",
"dependencies": {
"@event-driven-io/emmett": "0.23.0-alpha.12",
"@event-driven-io/emmett-expressjs": "0.23.0-alpha.12",
"@event-driven-io/emmett-mongodb": "0.23.0-alpha.12"
"@event-driven-io/emmett": "0.30.0",
"@event-driven-io/emmett-expressjs": "0.30.0",
"@event-driven-io/emmett-mongodb": "0.30.0"
},
"devDependencies": {
"@testcontainers/mongodb": "^10.10.3",
Expand Down
2 changes: 0 additions & 2 deletions samples/webApi/expressjs-with-postgresql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.5'

services:
app:
build:
Expand Down
28 changes: 14 additions & 14 deletions samples/webApi/expressjs-with-postgresql/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions samples/webApi/expressjs-with-postgresql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
},
"homepage": "https://github.com/event-driven-io/emmett#readme",
"dependencies": {
"@event-driven-io/emmett": "0.26.0",
"@event-driven-io/emmett-expressjs": "0.26.0",
"@event-driven-io/emmett-postgresql": "0.26.0"
"@event-driven-io/emmett": "0.30.0",
"@event-driven-io/emmett-expressjs": "0.30.0",
"@event-driven-io/emmett-postgresql": "0.30.0"
},
"devDependencies": {
"@testcontainers/postgresql": "^10.10.3",
Expand Down
15 changes: 13 additions & 2 deletions src/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ export default defineConfig({
logo: '/logo.png',
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Getting Started', link: '/getting-started' },
{
text: 'Documentation',
items: [
{ text: 'Overview', link: '/overview' },
{ text: 'Getting started', link: '/getting-started' },
{ text: 'API reference', link: '/api-docs' },
],
},
{ text: '🧑‍💻 Join Discord Server', link: 'https://discord.gg/fTpqUTMmVa' },
{
text: 'Release Notes',
Expand All @@ -27,7 +34,11 @@ export default defineConfig({
sidebar: [
{
text: 'Documentation',
items: [{ text: 'Getting Started', link: '/getting-started' }],
items: [
{ text: 'Overview', link: '/overview' },
{ text: 'Getting Started', link: '/getting-started' },
{ text: 'API reference', link: '/api-docs' },
],
},
],

Expand Down
2 changes: 1 addition & 1 deletion src/docs/api-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
outline: deep
---

# API docs
# API reference

## Event

Expand Down
54 changes: 54 additions & 0 deletions src/docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Overview

Everything you need to know about Emmett and Event Sourcing.

## First steps

If you are new to Emmett or Event Sourcing, no problem.

The [Getting Started](/getting-started) guide will help you with your first Emmett project.

## Getting help

If you need help or got stuck, feel free to ask on the [Emmett Community Discord Server](https://discord.gg/fTpqUTMmVa).

## API reference

The [API reference](/api-docs) provides you with definitions and insights of Emmetts core building blocks:

- **Events** are the centerpiece of event-sourced systems. They represent both critical points of the business process but are also used as the state.
- **Commands** represent the intent to perform a business operation.
- **Event Store** for recording events
- **Command Handlers** are responsible for handling business logic. They read events from the event store for specific events and build a decision model. Then, check business rules and perform the intended business operation, resulting in one or more events to record the change.

## How the documenantation is organized

Currently documentation for Emmett is spread across several places: This website, the [Emmett Discord](https://discord.gg/fTpqUTMmVa) and [quite a few blog articles](/overview#further-reading).
At the moment we are in the process of consolidating and refactoring these into a single documentation on this website.

Our aim is that each part of the documenation roughly falls into one of these four categories:

- **Tutorials** are lessons that take you by the hand, guiding you step-by-step towards building your own applications with Emmett. Start here if you are new to Emmett, Event Sourcing or writing applications with Typescript. Our [Getting Started](/getting-started) guide is a good place to look at.
- **Topic guides** discuss key topics and concepts at a fairly high level and provide useful background information and explanation.
- **Reference guides** contain technical reference for APIs and other aspects of Emmett. They describe how it works and how to use it, but assume that you have a basic understanding of key concepts.
- **How-to guides** are recipes. They guide you through the steps involved in addressing key problems and use-cases. They are more advanced than tutorials and assume some knowledge of how Emmett works.

In fact, we aim at using [Diataxis](https://diataxis.fr) and its [workflow](https://diataxis.fr/how-to-use-diataxis/) as a systematic, user-centric approach to documentation.

## Further reading

### Blog articles about Emmett

- [Announcing Emmett! Take your event-driven applications back to the future!](https://event-driven.io/en/introducing_emmett/)
- [Event Sourcing on PostgreSQL in Node.js just became possible with Emmett](https://event-driven.io/en/emmett_postgresql_event_store/)
- [Writing and testing event-driven projections with Emmett, Pongo and PostgreSQL](https://event-driven.io/en/emmett_projections_testing/)
- [Event Sourcing with Emmett: Reducing the Entry Barrier](https://medium.com/@mbneto/event-sourcing-with-emmett-how-to-reduce-the-entry-barrier-bf2d638c0437)
- [Testing Event Sourcing, Emmett edition](https://event-driven.io/en/testing_event_sourcing_emmett_edition/)
- [Using event metadata in event-driven projections](https://event-driven.io/en/projections_and_event_metadata/)
- [How to configure a custom Test Container on the EventStoreDB example](https://event-driven.io/en/custom_test_container_on_esdb_example/)

### Related Blogs

- [How TypeScript can help in modelling business workflows](https://event-driven.io/en/how_to_have_fun_with_typescript_and_workflow/)
- [How to build an in-memory Message Bus in TypeScript](https://event-driven.io/en/inmemory_message_bus_in_typescript/)
- [How to tackle compatibility issues in ECMA Script modules (and in general)](https://event-driven.io/en/how_to_tackle_esmodules_compatibility_issues/)
Loading