Configuration reference

Supported databases

The database engines Kiwi ORM supports, how each is selected, and what has been verified against live servers.

ORM Current 3 min read Updated

The same three modes, the same pipeline and the same code run across every supported engine, with sync and async execution throughout, stored procedure support on every backend and transaction management built in.

Engines#

Engine Connect with Notes
SQL Server UseSqlServer or Configure<SqlServerDatabaseSpecification>
PostgreSQL UsePostgreSql
MySQL UseMySql
MariaDB UseMariaDb
SQLite UseSQLite
Oracle Configure<OracleDatabaseSpecification> Managed driver (Oracle.ManagedDataAccess.Core)
Firebird UseFirebird Firebird folds unquoted names to upper case; KMQL's {{T:}} and {{C:}} quote correctly
IBM DB2 Configure<Db2DatabaseSpecification>
Informix Configure<InformixDatabaseSpecification> HCL Informix.Net.Core driver (64-bit, no client SDK needed), or IBM's classic driver where installed. Positional-parameter wrapper applied automatically
SAP HANA Configure<SapHanaDatabaseSpecification> Sap.Data.Hana.Net driver
Microsoft Access Configure<MsAccessDatabaseSpecification> ACE 12 provider

The Configure<...> form takes the connection string: i.Configure<SqlServerDatabaseSpecification>(connectionString). The specification classes live in Kiwify.Kiwi.ORM.Core.Specifications.Providers.

Note

Published Kiwify Labs materials describe "11+ databases" and name Sybase and ODBC in the brochure's engine list, whereas the engines implemented in the source today are the eleven above (SAP HANA and Microsoft Access in place of Sybase and ODBC). Confirm the list for your release with Kiwify Labs.

ADO.NET drivers#

Kiwi ORM sits on top of ADO.NET, so your application references the driver for each engine it uses. The tooling can fetch one for you:

text
kiwi orm install-driver        # restores the driver into ~/.kiwi-orm/drivers (or adds it to a project)

Set KIWI_ORM_DRIVER_CACHE to change the location of the driver cache.

What has been verified#

The schema tooling (entity generation and migrations) has been executed against a real server for all eleven engines, covering the initial migration, deltas, defaults and rollback: SQLite, PostgreSQL, SQL Server 2022 and Express, MySQL 8.4, MariaDB 11, Oracle Free, Firebird 5, DB2 11.5, SAP HANA Express, Microsoft Access (ACE 12) and Informix 14.10.

The runtime benchmark covers PostgreSQL, SQL Server, MySQL, MariaDB, Firebird, SQLite and Informix (Kiwi only). The CTE benchmark additionally covers Oracle and SAP HANA.

CTE support#

Managed CTEs have a provider per engine, and the dialect-specific parts (alias rules, join style in the recursive term, WITH vs WITH RECURSIVE) are handled per provider. The CTE benchmark has been run on PostgreSQL, SQL Server, MySQL, MariaDB, Firebird, SQLite, Informix, Oracle and SAP HANA. Published materials cite nine to ten engines, so check the current list. See Common table expressions.

Choosing the engine at run time#

Because only one line names the engine, you can pick it from configuration:

csharp
var kiwi = DatabaseContext.CreateContext<SalesContext>(i =>
{
    switch (settings.Provider)
    {
        case "postgresql": i.UsePostgreSql(settings.ConnectionString); break;
        case "sqlserver":  i.UseSqlServer(settings.ConnectionString);  break;
        // ...
    }
});

Keep all queries portable with KMQL (see Raw SQL with KMQL) and the rest of your data layer does not change.