SimplCommerce icon indicating copy to clipboard operation
SimplCommerce copied to clipboard

Use multiple databases

Open unencode opened this issue 5 years ago • 2 comments

Been trying to figure this out. Is it possible to use a second database (second data context) inside a module?

I have a separate MSSQL database that I need to reference product data from at runtime.

unencode avatar May 18 '20 02:05 unencode

Is there a proper reason to access a second database, if so I think you can register a second IDbContext then you can use DI to retrieve `IEnumerable<IDbContext>

hishamco avatar May 18 '20 03:05 hishamco

I just implemented the IdentityServer4 persistence layer using two additional DbContexts (same postgres database like for SimplCommerce, different schema "security" though). I guess the schema of that separate database is maintained somewhere else? Do you really need to use EF for this purpose? Maybe it's enough to add a MSSQL server link and use a couple of views?

fhebel avatar May 18 '20 12:05 fhebel