Table of Contents

Class MariaDbDialect

Namespace
NextORM.MariaDb
Assembly
nextorm.mariadb.dll

MariaDB dialect: the MySQL family plus the INTERSECT ALL/EXCEPT ALL set-operation variants (MariaDB 10.4+) and the window percentile functions PERCENTILE_CONT/MEDIAN (MariaDB 10.3+), neither of which MySQL implements.

public sealed class MariaDbDialect : MySqlDialect, ISqlDialect
Inheritance
MariaDbDialect
Implements
Inherited Members
Extension Methods

Constructors

MariaDbDialect()

Creates an unversioned MariaDB dialect: no version-gated form is emitted, so UPDATE ... RETURNING and every version-gated native function are rejected. Equivalent to the shared Instance.

public MariaDbDialect()

MariaDbDialect(Version?)

Creates a MariaDB dialect for serverVersion. MariaDB 13.0+ exposes UPDATE ... RETURNING; the native functions carry their own minima. null is the unversioned form, which rejects every version-gated feature.

public MariaDbDialect(Version? serverVersion)

Parameters

serverVersion Version

The MariaDB server version, or null for unset.

Fields

Instance

Gets the shared MariaDB dialect instance.

public static readonly MariaDbDialect Instance

Field Value

MariaDbDialect

Properties

Lock

MariaDB renders row locking with LOCK IN SHARE MODE, which — unlike MySQL's — accepts the NOWAIT/SKIP LOCKED lock options, so the MySQL renderer is not reused.

public override ILockRenderer Lock { get; }

Property Value

ILockRenderer

MySqlFunctions

MariaDB inherits the MySQL native-function surface except UUID_TO_BIN/BIN_TO_UUID, which it does not implement (it converts through CAST(... AS BINARY(16))/CAST(... AS UUID)), and adds the MariaDB-only names (extended regexp, NVL/NVL2, ADD_MONTHS, MONTHS_BETWEEN, TO_CHAR/TO_DATE/TO_NUMBER, KDF, XXH3/XXH32, JSON_DETAILED/JSON_COMPACT, the JSON canonicalisation pair JSON_EQUALS/JSON_NORMALIZE, sequence access and ROWNUM). MONTHS_BETWEEN, TO_DATE, TO_NUMBER and XXH3/XXH32 carry their own version minima (12.2.1 / 12.3 / 12.2.1 / 13.1), so an unversioned dialect — and every server below the minimum — refuses them before any SQL is emitted.

public override IMySqlFunctions MySqlFunctions { get; }

Property Value

IMySqlFunctions

SupportsAnyValueAggregate

MariaDB has no ANY_VALUE in the supported range: the SQL-2023 T626 feature (MDEV-10426) is still pending and targeted for 13.2, so any_agg is gated off even though MySQL implements it.

public override bool SupportsAnyValueAggregate { get; }

Property Value

bool

SupportsApply

MariaDB has no lateral/APPLY source: 11.4 rejects the generated cross join lateral (…) and left join lateral (…) on true derived-table spelling, so APPLY is refused by the capability gate before any SQL is produced. The one expressible shape is the inherited SupportsDirectApplyTableFunction form: an eligible correlated JSON_TABLE correlates implicitly in FROM and needs no LATERAL. MySQL 8.0.14+ supports the lateral spelling as well.

public override bool SupportsApply { get; }

Property Value

bool

SupportsBulkCopy

MariaDB has a native bulk path: MySqlBulkCopy loads through LOAD DATA LOCAL INFILE, which requires AllowLoadLocalInfile=true on the connection and local_infile enabled on the server. Both are read-only preflight checks: a missing permission is never changed by nextorm, the portable path is used in Auto, and Native refuses by name. MariaDB additionally honours CheckConstraints=false through scoped session controls that are restored after the write.

public override bool SupportsBulkCopy { get; }

Property Value

bool

SupportsIntersectExceptAll

True when the provider can render the * ALL variants of INTERSECT and EXCEPT (intersect all / except all). UNION ALL is not covered by this flag because it is universally supported. SQL Server does not support either variant, and SQLite has no intersect all/except all at all, so the safe default is false.

public override bool SupportsIntersectExceptAll { get; }

Property Value

bool

SupportsJson

MariaDB has no native JSON storage type, so this is overridden to stay false on purpose. Its JSON type is an alias for LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin plus a column-level CHECK (json_valid(col)); information_schema.COLUMNS.DATA_TYPE reports longtext and the server stores the caller's text verbatim (no normalisation, no binary document type). Exposing that as native storage would misrepresent the storage and change the binding contract, so Auto stays text, an explicit Text stays text, and an explicit Native is refused with the named NotSupportedException before any SQL runs.

public override bool SupportsJson { get; }

Property Value

bool

SupportsPercentileWindow

MariaDB 10.3+ renders PERCENTILE_CONT/PERCENTILE_DISC as window functions.

public override bool SupportsPercentileWindow { get; }

Property Value

bool

SupportsRegex

MariaDB has no REGEXP_LIKE; it matches with the REGEXP operator and replaces with REGEXP_REPLACE.

public override bool SupportsRegex { get; }

Property Value

bool

SupportsSelectWhereMinMax

MariaDB 10.2+ renders SelectWhereMax/SelectWhereMin with a window function.

public override bool SupportsSelectWhereMinMax { get; }

Property Value

bool

SupportsTemporalTable

MariaDB 10.3+ supports the FOR SYSTEM_TIME temporal-table clause on system-versioned tables.

public override bool SupportsTemporalTable { get; }

Property Value

bool

SupportsUpdateReturning

MariaDB 13.0+ appends RETURNING to a single-table UPDATE. INSERT/DELETE RETURNING stays unsupported outside the bulk path.

public override bool SupportsUpdateReturning { get; }

Property Value

bool

UuidGenerators

MariaDB 11.7+ renders both UUID generators; MySQL has no v4/v7 generator. An unversioned dialect rejects them, because 11.4 has neither.

public override IUuidGenerators UuidGenerators { get; }

Property Value

IUuidGenerators

Methods

MakeRegexMatch(string, string, bool)

Renders a regular-expression match predicate over the already-rendered value. pattern is the raw pattern text (the dialect renders and escapes the string literal itself) and ignoreCase selects IgnoreCase. Reached only when SupportsRegex is true.

public override string MakeRegexMatch(string value, string pattern, bool ignoreCase)

Parameters

value string
pattern string
ignoreCase bool

Returns

string

MakeRegexReplace(string, string, string, bool)

Renders a regular-expression replace over the already-rendered value, replacing every match as Replace(string, string, string) does. pattern and replacement are raw text (the dialect renders and escapes the literals). Reached only when SupportsRegex is true.

A replacement backreference uses the provider's group syntax (C# $1, SQL \1); it is not rewritten, so a replacement with a group reference is not portable as written.

public override string MakeRegexReplace(string value, string pattern, string replacement, bool ignoreCase)

Parameters

value string
pattern string
replacement string
ignoreCase bool

Returns

string

SupportsTemporalKind(TemporalKind)

MariaDB has no CONTAINED IN, so it is gated off; the other kinds are supported.

public override bool SupportsTemporalKind(TemporalKind kind)

Parameters

kind TemporalKind

Returns

bool