Category: DatabaseIndependence
-
Database Indepedence–part 090 of n- reorg
When I started working on database independence, I realized that too many provider options can confuse non-technical users. I added a plugin property that indicates whether a separate database server is required. This gives the application enough information to present the available providers more clearly, without requiring users to understand the technical differences between them.…
-
Database Indepedence–part 080 of n- nuget packages
So, to achieve Database Independence, I need 2 general nuget packages and one per each EFCore version https://www.nuget.org/packages/EFCore_DaIn/ – has the interfaces of plugin (provider name) and connection data (name, connection string, database name) https://www.nuget.org/packages/EFCore_DaInLoader – loads the plugins from the web or from local hard disk , with EF Core versions ( 10,11…) https://www.nuget.org/packages/EFCore_DaIn_10…
-
Database Independence–part 070 of n – loading and retrieving
So now I can choose between Postgresql, Sqlite, SqlServer and MongoDb . Next phase is when the app administrator chooses a database- and you expect the app to start with this selection of database provider. So 2 new functions are needed, in which the provider name, connection string and database name are saved And there…
-
Database Independence–using TestContainers
Test without Database installing – I use Testcontainers For SQL Server, PostgreSQL, and MongoDB, I use Testcontainers to run the database engines in disposable Docker containers during the integration tests. This lets me test the real EF Core providers instead of replacing them with mocks or an in-memory database. The test project references the provider-specific…
-
VaRe&DaIn–part 060 of n–OptionsBuilder
Now I want to create the database in each provider (Sqlite, MsSql, Postgresql, Mongo) Let’s say that I have the database context and I want to create the database from a simple connection string For this I need a common interface , IEFCore_DatabasePlugin, to function the same for all database I target .NET 10 and…
-
VaRe&DaIn–part 050 of n–practical database independence
When I think about database independence, I need to consider two perspectives: the programmer and the application administrator. As a programmer, I want debugging to be straightforward, regardless of which database I am using. I also want to understand how to develop and test against any supported database without having to redesign the application for…
-
VaRe&DaIn–part 040 of n–DatabaseIndependence
Now comes the real part. I want the app to work with any database—SQLite, PostgreSQL, SQL Server, and MongoDB—and to choose the database type and connection string at startup. In the .NET world, I see two main options: 1. The plain SQL-style approach: I define an interface with methods for the data I need in…
-
VaRe&DaIn–part 001 of n – start idea
I wanted a proof-of-concept app that is truly database-independent: SQL Server, PostgreSQL, MongoDB, or just a local SQLite file. Partly for fun, partly for the engineering challenge, and mostly because real enterprise installs rarely have the same infrastructure. That is the **DaIn (Database Independence)** goal behind this project. That idea became **Vacation Relay (VaRe)**: when…
-
VaRe&DaIn–part 010 of n–creation of database.md
The first iteration of the project should create the database – no matter if SqlServer, PostgreSql, Sqlite or MongoDB ( see references ) . Database independence sounds simple until,because I use simple connections, the app should do schema creation. The challenge is that each backend speaks a different language. SQL Server and PostgreSQL need SQL…