Class MySqlDialect
MySQL's SQL flavour: snake_case naming, identifiers, backtickLIMIT/OFFSET, row-wise tuple
comparisons, and AUTO_INCREMENT keys — which MySQL cannot read back from an insert (no
RETURNING), so generated-key backfill is rejected with guidance: declare a client-generated key.
Collection columns do not exist; collection clauses degrade to the gated client-side residual.
public class MySqlDialect : SqlDialect
- Inheritance
-
MySqlDialect
- Derived
- Inherited Members
Properties
GeneratedKeyDdl
The DDL column suffix declaring a database-generated key (e.g. GENERATED BY DEFAULT AS IDENTITY).
public override string GeneratedKeyDdl { get; }
Property Value
System
The OpenTelemetry db.system value (e.g. postgresql, mysql, mssql).
public override string System { get; }
Property Value
Methods
AlterColumnType(string, string, string)
The DDL altering a column's type (a dialect may need a cast clause).
public override string AlterColumnType(string quotedTable, string quotedColumn, string sqlType)
Parameters
Returns
BindValue(object?)
Converts a value before binding (a dialect may need CLR-side coercion, e.g. arrays); identity by default.
public override object? BindValue(object? value)
Parameters
valueobject
Returns
CreateIndexSql(string, string, string, bool, IndexMethod, string?)
The DDL creating an index with a structure and an optional filtered predicate (already rendered as a SQL fragment with inlined literals). The base dialect builds default-structure indexes, filtered or not; a method it has no structure for is rejected with guidance.
public override string CreateIndexSql(string quotedName, string quotedTable, string columns, bool unique, IndexMethod method, string? filter)
Parameters
quotedNamestringThe quoted index name.
quotedTablestringThe quoted table.
columnsstringThe rendered key column list.
uniqueboolWhether the index enforces uniqueness.
methodIndexMethodThe index structure.
filterstringThe rendered partial-index predicate, or
null.
Returns
Quote(string)
Quotes an identifier (table or column name).
public override string Quote(string identifier)
Parameters
identifierstring
Returns
SqlType(Type)
The DDL type for a CLR type (used by CREATE TABLE migrations).
public override string SqlType(Type type)
Parameters
typeType
Returns
TupleComparison(IReadOnlyList<string>, ComparisonOperator, IReadOnlyList<string>)
Renders a row-wise tuple comparison; the base dialect cannot express it.
public override string TupleComparison(IReadOnlyList<string> columns, ComparisonOperator op, IReadOnlyList<string> parameters)
Parameters
columnsIReadOnlyList<string>The quoted columns.
opComparisonOperatorThe comparison operator.
parametersIReadOnlyList<string>The bound values' parameter markers.