prooph event store recipes (#1479)

event store interface should alias instance which wraps internal event store client
wrapper gets registered by bundle package due it is the proper place to define an alias
console command will be moved into the bundle
This commit is contained in:
Piotr Zając
2023-01-18 14:27:07 +01:00
committed by GitHub
parent b263573589
commit 791bdc77c3
5 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
prooph_event_store:
stores:
default:
event_store: 'app.event_store.default'
services:
_defaults:
public: false
Prooph\EventStore\EventStore: '@prooph_event_store.default'
Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator: null

View File

@@ -0,0 +1,9 @@
{
"bundles": {
"Prooph\\Bundle\\EventStore\\ProophEventStoreBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}

View File

@@ -0,0 +1,20 @@
services:
_defaults:
public: false
app.event_store.default:
class: Prooph\EventStore\Pdo\PostgresEventStore
arguments:
- '@prooph_event_store.message_factory'
- '@app.event_store.pdo_connection.postgres'
- '@app.event_store.postgres.persistence_strategy'
app.event_store.pdo_connection.postgres:
class: \PDO
arguments:
- '%env(EVENT_STORE_DSN)%'
- '%env(EVENT_STORE_USER)%'
- '%env(EVENT_STORE_PASSWORD)%'
app.event_store.postgres.persistence_strategy:
class: Prooph\EventStore\Pdo\PersistenceStrategy\PostgresSingleStreamStrategy

View File

@@ -0,0 +1,13 @@
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"copy-from-package": {
"scripts/": "%CONFIG_DIR%/scripts/"
},
"env": {
"EVENT_STORE_DSN": "pgsql:host=127.0.0.1;dbname=event_streams",
"EVENT_STORE_USER": "user",
"EVENT_STORE_PASSWORD": "password"
}
}

View File

@@ -0,0 +1,4 @@
* Modify your EVENT_STORE_* configuration in <fg=green>.env</>
* Create event streams and projections tables using SQL scripts
in <comment>%CONFIG_DIR%/scripts/*</comment>