Preview Support for MariaDB is Now Available in RepoDB

6 minute read

Published:

We are excited to announce the preview release of MariaDB support for RepoDB — bringing our hybrid ORM’s fluent CRUD, raw-SQL, and Bulk Operations capabilities to MariaDB, built on top of the newly-released RepoDB Connectors.

What’s in this preview?

The new RepoDb.MariaDb package brings the full RepoDB experience to MariaDB:

It follows the same programming model you already use with our SQL Server, PostgreSQL, MySQL, SQLite, Oracle, and DB2 extensions — the same fluent API, the same lightweight philosophy, now targeting MariaDB.

Powered by RepoDB Connectors

This is also the first provider to ship on top of RepoDB Connectors, our new home for dedicated, provider-specific ADO.NET data providers. Instead of leaning on a general-purpose driver, RepoDb.MariaDb sits directly on the MariaDb-prefixed ADO.NET objects — MariaDbConnection, MariaDbCommand, MariaDbDataReader, MariaDbTransaction, and friends — giving RepoDB a purpose-built foundation for MariaDB’s protocol, type system, and bulk-loading behavior.

You get to choose the underlying driver that best fits your project, since both connectors expose the same API surface:

Whichever one you install underneath, RepoDb.MariaDb and RepoDb.MariaDb.BulkOperations work exactly the same way on top.

A note on licensing: MySql.Data is published by Oracle under a dual license — GPLv2 (with the FOSS Exception) or a commercial license — not MIT/Apache. If that doesn’t fit your project’s licensing model, use RepoDb.Connector.MariaDbConnector instead, which sits on MySqlConnector, an MIT-licensed driver. Please review the terms of whichever driver you pick and make sure it’s compatible with your project.

Read more about the connectors themselves, including the architecture behind them, in our announcement post and the accompanying architecture deep dive.

Why MariaDB?

MariaDB has grown into a first-class choice for teams migrating off MySQL or standing up new cloud-native workloads, and it’s been a recurring request from the community. This preview closes that gap, so teams running on MariaDB can get the same fast, hybrid data-access experience — and the same high-throughput Bulk Operations — that RepoDB is known for on other providers, all backed by a connector built specifically for it rather than borrowed from a neighboring provider.

Getting started

Install the packages, picking the underlying driver you prefer:

> Install-Package RepoDb.MariaDb
> Install-Package RepoDb.MariaDb.BulkOperations

Then follow the Get Started with MariaDb tutorial to wire it up in your application.

Basic CRUD

using (var connection = new MariaDbConnection(connectionString))
{
    // Insert
    var customer = new Customer { Name = "John Doe", Address = "New York" };
    var id = connection.Insert(customer);

    // Query
    var queriedCustomer = connection.Query<Customer>(e => e.Id == id).FirstOrDefault();

    // Update
    queriedCustomer.Address = "California";
    var updatedRows = connection.Update(queriedCustomer);

    // Delete
    var deletedRows = connection.Delete<Customer>(id);

    // Merge
    var mergedCustomer = new Customer { Id = id, Name = "John Doe", Address = "Washington" };
    var mergeResult = connection.Merge(mergedCustomer, qualifiers: e => e.Id);
}

Raw-SQL

using (var connection = new MariaDbConnection(connectionString))
{
    // ExecuteQuery
    var customers = connection.ExecuteQuery<Customer>("SELECT * FROM Customer WHERE Address = @Address;",
        new { Address = "California" });

    // ExecuteNonQuery
    var affectedRows = connection.ExecuteNonQuery("UPDATE Customer SET Address = @Address WHERE Id = @Id;",
        new { Address = "Washington", Id = 10045 });

    // ExecuteScalar
    var count = connection.ExecuteScalar<int>("SELECT COUNT(*) FROM Customer;");
}

Bulk Operations

The essentials, against an entity type:

using (var connection = new MariaDbConnection(connectionString))
{
    // BulkInsert
    var customers = GetCustomersToInsert();
    var insertedRows = connection.BulkInsert(customers);

    // BulkUpdate
    var customersToUpdate = GetCustomersToUpdate();
    var updatedRows = connection.BulkUpdate(customersToUpdate);

    // BulkMerge
    var customersToMerge = GetCustomersToMerge();
    var mergedRows = connection.BulkMerge(customersToMerge, qualifiers: e => e.Id);

    // BulkDelete
    var customersToDelete = GetCustomersToDelete();
    var deletedRows = connection.BulkDelete(customersToDelete);

    // BulkDeleteByKey
    var keysToDelete = new[] { 10045, 10046, 10047 };
    var deletedByKeyRows = connection.BulkDeleteByKey<Customer>(keysToDelete);
}

They also work against a table name, for when you don’t have (or don’t want) a strongly-typed entity:

using (var connection = new MariaDbConnection(connectionString))
{
    var customers = GetCustomersToInsert();
    var insertedRows = connection.BulkInsert("Customer", customers);

    var customersToMerge = GetCustomersToMerge();
    var qualifiers = Field.From("LastName", "BirthDate");
    var mergedRows = connection.BulkMerge("Customer", customersToMerge, qualifiers: qualifiers);
}

And with custom qualifiers plus a batch size, for finer control over BulkUpdate/BulkMerge matching and how many rows are sent per round-trip:

using (var connection = new MariaDbConnection(connectionString))
{
    var customersToUpdate = GetCustomersToUpdate();
    var qualifiers = Field.From("LastName", "BirthDate");

    var updatedRows = connection.BulkUpdate(customersToUpdate,
        qualifiers: qualifiers,
        batchSize: 1000);
}

Every operation also has an async counterpart (BulkInsertAsync, BulkUpdateAsync, BulkMergeAsync, BulkDeleteAsync, BulkDeleteByKeyAsync), so they drop straight into async pipelines:

using (var connection = new MariaDbConnection(connectionString))
{
    var customers = GetCustomersToInsert();
    var insertedRows = await connection.BulkInsertAsync(customers);

    var customersToMerge = GetCustomersToMerge();
    var mergedRows = await connection.BulkMergeAsync(customersToMerge, qualifiers: e => e.Id);
}

Why Bulk Operations matter

The fluent CRUD operations above are great for row-by-row or small-batch work, but they still cost one round-trip per call. When you are moving thousands (or millions) of rows — a nightly import, a data migration, a catch-up sync — that per-row overhead adds up fast. Bulk Operations push the batching down to the connector/server boundary, so you get:

  • Fewer round-trips — a single call moves the entire set instead of one call per row
  • Lower CPU and network overhead — less serialization/deserialization chatter between your app and MariaDB
  • Consistent behavior across providers — the same BulkInsert, BulkUpdate, BulkMerge, BulkDelete, and BulkDeleteByKey calls you already use for SQL Server, PostgreSQL, MySQL, Oracle, and DB2 now work against MariaDB too, so migrating workloads between providers doesn’t mean rewriting your data-access layer
  • Predictable throughput at scale — ideal for ETL jobs, backfills, and any workload where dataset size — not row count per call — is the bottleneck

A preview, not a final release

As a preview package, RepoDb.MariaDb (and its Bulk Operations counterpart), along with the underlying RepoDB Connectors it’s built on, are still maturing — APIs and behavior may change before a stable release ships. We would love to hear your feedback as you try it out; it directly shapes what we prioritize on the way to general availability.

Please support us

Give a ⭐ to our Github repository | Follow me at X / Twitter | Connect with us at our official Teams Channel
Apache License 2.0 — Copyright © 2026 by Michael Camara Pendon / Create a Request