You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Different MsSql Database for Read Models and Events #417
It isn't possible to do easy. You'll have to do some IoC configuration to pass a different instance of the MSSQL connection to read model updaters and readers.
This limitation stems from the fact that the database is configured globally and not per UseEventStore()/UseReadModelStore() call. And to say frankly it's kinda pain in the butt.
Currently IMsSqlConnection, IMsSqlConnectionFactory etc. are registered directly in the container using ConfigureMsSql(). Instead, UseMssqlEventStore() (or maybe an overload of that method?) should accept IMsSqlConfiguration directly and use that IMsSqlConfiguration to instantiate MsSqlEventPersistence itself, instead of MsSqlEventPersistence using container to request IMsSqlConnection. The same goes for UseMssqlReadModel().
If I find the time, I'll try to put together something like this next week.
BTW, the same problem occurs in SQLite and probably other DB providers.
Activity
rasmus commentedon Jan 7, 2018
It isn't possible to do easy. You'll have to do some IoC configuration to pass a different instance of the MSSQL connection to read model updaters and readers.
Yaevh commentedon Jun 16, 2021
This limitation stems from the fact that the database is configured globally and not per
UseEventStore()/UseReadModelStore()call. And to say frankly it's kinda pain in the butt.Currently
IMsSqlConnection,IMsSqlConnectionFactoryetc. are registered directly in the container usingConfigureMsSql(). Instead,UseMssqlEventStore()(or maybe an overload of that method?) should acceptIMsSqlConfigurationdirectly and use thatIMsSqlConfigurationto instantiateMsSqlEventPersistenceitself, instead ofMsSqlEventPersistenceusing container to requestIMsSqlConnection. The same goes forUseMssqlReadModel().If I find the time, I'll try to put together something like this next week.
BTW, the same problem occurs in SQLite and probably other DB providers.
rasmus commentedon Jun 17, 2021
Something that needs to be investigated for 1.0 for certain
rasmus commentedon Mar 3, 2022
Done as done as part of 1.0 release
https://github.com/eventflow/EventFlow/blob/develop-v1/MIGRATION_GUIDE.md#notable-new-features-in-1x