Open Closed

Multiple Database support #6


0
bhyatz created

We wish to support multiple databases, both oracle using the devart driver and SQL Server. The current depends on EntityFrameworkCoreModule depends on AbpEntityFrameworkCoreSqlServerModule. We wish to be able to switch between oracle and sql server using a configuration setting in the appsettings.json. 1. If we remove the AbpEntityFrameworkCoreSqlServerModule module and change the Configure


1 Answer(s)
  • 0
    hikalkan created
    1. options.UseSqlServer() is an extension method defined in the https://www.nuget.org/packages/Volo.Abp.EntityFrameworkCore.SqlServer package and there is no Oracle package. However, Volo.Abp.EntityFrameworkCore.SqlServer is just a simple wrapper. See https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Other-DBMS to understand how to directly use DBMS extension method. This is for MySQL, but will be similar for Oracle too.
    2. Yes. You can have both SQL Server and Oracle nuget package references and call the extension method(s) conditionally.
    3. Yes, in current code AbpEntityFrameworkCoreSqlServerModule is an empty module. But I suggest to remove the related NuGet package when you remove a DependsOn dependency, as a good practice.
    4. See https://github.com/abpframework/abp/issues/2131#issuecomment-563354065

    Have a nice day.