Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!
MariaDB
The Shiny.DocumentDb.MariaDb package provides a MariaDB-backed document store. MariaDB speaks the MySQL
wire protocol and uses the same MySqlConnector driver, so
MariaDbDatabaseProvider extends MySqlDatabaseProvider and inherits its entire
document surface — CRUD, LINQ-to-SQL translation, JSON property indexes, batch/bulk writes, temporal history,
computed columns, soundex, and full-text search all lower to identical SQL. Only the handful of places where
MariaDB genuinely diverges from MySQL 8 are overridden.
When to Use
Section titled “When to Use”- Existing MariaDB estate (or a MariaDB-compatible service such as SkySQL)
- You want the MySQL provider’s feature set against a MariaDB server
Installation
Section titled “Installation”dotnet add package Shiny.DocumentDb.MariaDb-
Direct instantiation
using Shiny.DocumentDb;using Shiny.DocumentDb.MariaDb;var store = new DocumentStore(new DocumentStoreOptions{DatabaseProvider = new MariaDbDatabaseProvider("Server=localhost;Database=mydb;User=root;Password=pass;")}); -
Dependency injection
services.AddDocumentStore(opts =>{opts.DatabaseProvider = new MariaDbDatabaseProvider("Server=localhost;Database=mydb;User=root;Password=pass;");});
Differences from the MySQL provider
Section titled “Differences from the MySQL provider”Everything is inherited from the MySQL provider except:
- Spatial runs the portable envelope tier (bounding-box prune + in-process geometry refine) rather than
MySQL’s native SRID-4326
ST_*pushdown. MariaDB’s geometry columns don’t accept MySQL’sSRIDcolumn attribute, and — critically — MariaDB’sST_Distanceis not metric for SRID-4326 geometry, so a nativeWithinRadius/distance query would return wrong results. The portable tier computes true metres in C# and is correct everywhere. The dedicatedGeo*methods andMapSpatialPropertywork as normal;DocumentFunctionsspatial predicates inside aWhereare not pushed down (use theGeo*methods). - Full-text proximity (
"a b"~5/"a b"@N) is dropped from the advertised Lucene capabilities — MariaDB boolean-mode full-text has no proximity operator, so proximity queries are rejected up front rather than emitting invalid SQL. Terms, phrases, prefixes, and required/optional/excluded terms all work, as doesMapFullTextProperty+FullTextSearch. - Array-valued queries are not supported. MariaDB has never shipped
JSON_TABLE(MDEV-16620, still open through 11.x) and has noLATERAL, so the outer-correlated array unnest that MySQL relies on cannot be expressed. Predicates and projections that unnest a JSON array —Any/Allover a collection (o => o.Lines.Any(l => …)), collection aggregates (o.Lines.Sum(l => l.Quantity)), andGroupByover an array element — throw a clearNotSupportedExceptionat query-build time. Use the MySQL provider for those queries, or restructure the model to avoid unnesting a JSON array. (Scalar array checks that don’t unnest, like.Count/.LengthviaJSON_LENGTH, still work.)
Limitations
Section titled “Limitations”- No
Backup()— usemariadb-dump(mysqldump) from your operations tooling. - Same stored-JSON-
nullvs missing-key collapsing (NULLIF(...,'null')) as the MySQL provider.