Table of Contents

Class SqlDialectBase

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Default implementations of the dialect contract. Only the parts that genuinely differ between dialects are abstract (MakeParam(string), MakePage(Paging, StringBuilder, KeywordCase)); everything else has a working generic-SQL default, so a dialect overrides just what is different. A class-A capability is expressed as a nullable capability object (for example Iif) and its Supports* flag is computed from the object's presence, so a dialect cannot report a capability without supplying its rendering; the remaining emitters default to a working generic body and are only overridden where a dialect deviates.

public abstract class SqlDialectBase : ISqlDialect
Inheritance
SqlDialectBase
Implements
Derived
Inherited Members
Extension Methods

Properties

AggregateFilterStyle

How the provider attaches a filter to an aggregate. The safe default is None, which rejects the filtering overloads; PostgreSQL and SQLite return AnsiFilter and ClickHouse returns IfCombinator. Declared as a default interface method so that existing external implementations keep compiling.

public virtual AggregateFilterStyle AggregateFilterStyle { get; }

Property Value

AggregateFilterStyle

ArrayJoinClause

Defaults to null; ClickHouse opts into the ARRAY JOIN clause.

public virtual IArrayJoinRenderer? ArrayJoinClause { get; }

Property Value

IArrayJoinRenderer

BatchUsesJoinedCommand

Defaults to false; SQL Server sends the batch as one ;-joined command so a #temp survives across statements.

public virtual bool BatchUsesJoinedCommand { get; }

Property Value

bool

ClickHouseAggregates

Defaults to null; ClickHouse opts into the ClickHouse-only aggregate catalogue (statistical, quantile-algorithm, array/tuple and time-series aggregates).

public virtual IClickHouseAggregateRenderer? ClickHouseAggregates { get; }

Property Value

IClickHouseAggregateRenderer

ConcatStringOperator

String concatenation operator, e.g. + or ||.

public virtual string ConcatStringOperator { get; }

Property Value

string

CreateTableAsSelectUsesSelectInto

Defaults to false; SQL Server materialises through SELECT ... INTO instead of CREATE TABLE ... AS SELECT.

public virtual bool CreateTableAsSelectUsesSelectInto { get; }

Property Value

bool

DateConversion

The provider's renderer for the ClickHouse date-conversion surface; null means the provider cannot express it. Declared as a default interface method so that existing external implementations keep compiling.

public virtual IDateConversionRenderer? DateConversion { get; }

Property Value

IDateConversionRenderer

DeleteJoinRequiresUsing

Defaults to false; PostgreSQL overrides it because its multi-table delete uses USING.

public virtual bool DeleteJoinRequiresUsing { get; }

Property Value

bool

DeleteRequiresWhere

Defaults to false; ClickHouse's ALTER TABLE ... DELETE requires a WHERE clause.

public virtual bool DeleteRequiresWhere { get; }

Property Value

bool

DistinctOn

Defaults to null; PostgreSQL opts into DISTINCT ON.

public virtual IDistinctOnRenderer? DistinctOn { get; }

Property Value

IDistinctOnRenderer

EmptyString

SQL literal for an empty string.

public virtual string EmptyString { get; }

Property Value

string

EnforcesScalarSubqueryCardinality

True when a scalar subquery used as an expression raises an error if it returns more than one row. PostgreSQL, SQL Server, MySQL, MariaDB and ClickHouse do; SQLite silently takes the first row, so Single/SingleOrDefault cannot rely on the engine there.

public virtual bool EnforcesScalarSubqueryCardinality { get; }

Property Value

bool

ExtremeRowRenderer

Defaults to null; a dialect with a native SelectWhereMax/SelectWhereMin strategy opts in.

public virtual IExtremeRowRenderer? ExtremeRowRenderer { get; }

Property Value

IExtremeRowRenderer

Iif

Defaults to null; every SQL provider exposes its native iif renderer.

public virtual IIifRenderer? Iif { get; }

Property Value

IIifRenderer

IndexHints

The provider's renderer for table index hints, or null when the provider has no native index-hint syntax (PostgreSQL without pg_hint_plan, ClickHouse). Declared as a default interface method so existing external implementations keep compiling; a dialect that returns null rejects a command carrying an index hint.

public virtual IIndexHintRenderer? IndexHints { get; }

Property Value

IIndexHintRenderer

LimitBy

Defaults to null; ClickHouse exposes the LIMIT n BY expr renderer.

public virtual ILimitByRenderer? LimitBy { get; }

Property Value

ILimitByRenderer

LobLocatorColumn

The name of the trailing column a dialect appends to a LOB-only projection so that the driver can stream the payload without buffering it, or null when no locator is needed. The payload stays ordinal 0 and the locator is rendered last; SQLite uses rowid, which makes DbDataReader.GetStream return a seekable SqliteBlob. The safe default is null; declared as a default interface method so existing external implementations keep compiling.

public virtual string? LobLocatorColumn { get; }

Property Value

string

Lock

Defaults to null; PostgreSQL, MySQL, MariaDB and SQL Server opt into row locking.

public virtual ILockRenderer? Lock { get; }

Property Value

ILockRenderer

MultiIf

Defaults to null; only ClickHouse opts into the multiIf multi-branch conditional.

public virtual IMultiIfRenderer? MultiIf { get; }

Property Value

IMultiIfRenderer

MySqlFunctions

Defaults to null; MySQL/MariaDB expose their native-function renderer.

public virtual IMySqlFunctions? MySqlFunctions { get; }

Property Value

IMySqlFunctions

NativeJsonProviderType

Defaults to JsonElement; ClickHouse uses JsonObject.

public virtual Type NativeJsonProviderType { get; }

Property Value

Type

NullSafeComparison

The renderer for the explicit null-safe comparison helpers, or null when the provider has not opted in. The safe default is null, which makes the translator reject both helper forms with an exception naming the provider and the form.

public virtual INullSafeComparisonRenderer? NullSafeComparison { get; }

Property Value

INullSafeComparisonRenderer

OuterJoinNullSettings

Provider settings that must be present query-locally so an OUTER JOIN yields SQL NULL for the unmatched side instead of the provider's column default. Defaults to null (every dialect but ClickHouse produces SQL nulls natively). ClickHouse returns join_use_nulls=1; the core preparation injects it for a reference-navigation query only and rejects a conflicting user-supplied value.

public virtual IReadOnlyList<KeyValuePair<string, string>>? OuterJoinNullSettings { get; }

Property Value

IReadOnlyList<KeyValuePair<string, string>>

Pivot

Defaults to null; SQL Server opts into the native PIVOT/UNPIVOT pair.

public virtual IPivotRenderer? Pivot { get; }

Property Value

IPivotRenderer

QuantileAggregates

The provider's renderer for the parameterised quantile aggregates; null means the provider cannot express them. Declared as a default interface method so that existing external implementations keep compiling.

public virtual IQuantileAggregateRenderer? QuantileAggregates { get; }

Property Value

IQuantileAggregateRenderer

RequireSubqueryAlias

True for providers that require a derived table (subquery in FROM) to have an alias.

public virtual bool RequireSubqueryAlias { get; }

Property Value

bool

RequiresIdentityInsertToggle

Defaults to false; SQL Server wraps explicit-identity inserts with SET IDENTITY_INSERT.

public virtual bool RequiresIdentityInsertToggle { get; }

Property Value

bool

RequiresQualifiedSelectStar

Defaults to false; MySQL/MariaDB override it because they reject a bare * mixed with explicit select expressions.

public virtual bool RequiresQualifiedSelectStar { get; }

Property Value

bool

RequiresRecursiveCteUnionAll

Defaults to false. When true, a recursive CTE body must be UNION ALL: a legacy WithRecursive declaration whose body is a distinct UNION is rejected during preparation (before execution and before the plan cache). SQL Server overrides it to true.

public virtual bool RequiresRecursiveCteUnionAll { get; }

Property Value

bool

ScalarFunctions

Defaults to null; every SQL provider exposes its cross-provider scalar-function renderer.

public virtual IScalarFunctions? ScalarFunctions { get; }

Property Value

IScalarFunctions

SequenceAggregates

Defaults to null; ClickHouse opts into the windowFunnel/retention/sequenceMatch aggregates.

public virtual ISequenceAggregateRenderer? SequenceAggregates { get; }

Property Value

ISequenceAggregateRenderer

SessionInfoFunctions

Defaults to null; a provider with a native spelling exposes its renderer.

public virtual ISessionInfoFunctions? SessionInfoFunctions { get; }

Property Value

ISessionInfoFunctions

SqlServerFunctions

Defaults to null; only SQL Server exposes the T-SQL-only scalar-function renderer.

public virtual ISqlServerFunctions? SqlServerFunctions { get; }

Property Value

ISqlServerFunctions

SqliteFunctions

The provider's renderer for the SQLite-only surface (Sqlite and SqliteFunctions), or null when the provider is not SQLite. Declared as a default interface method so existing external implementations keep compiling.

public virtual ISqliteFunctions? SqliteFunctions { get; }

Property Value

ISqliteFunctions

StringFormats

The provider's formatting surface for the culture-invariant CLR format specifiers of string.Format/ToString(format); null means the provider cannot render them. Declared as a default interface method so that existing external implementations keep compiling.

public virtual IStringFormatFunctions? StringFormats { get; }

Property Value

IStringFormatFunctions

StringSplit

The provider's renderer for a scalar string.Split; null means the provider cannot express it. Declared as a default interface method so that existing external implementations keep compiling.

public virtual IStringSplitRenderer? StringSplit { get; }

Property Value

IStringSplitRenderer

SupportsAnyLastAggregate

Defaults to false; ClickHouse opts into the any/anyLast aggregates.

public virtual bool SupportsAnyLastAggregate { get; }

Property Value

bool

SupportsAnyValueAggregate

Defaults to false; MySQL/MariaDB and ClickHouse opt into the arbitrary-value aggregate.

public virtual bool SupportsAnyValueAggregate { get; }

Property Value

bool

SupportsApply

True when the provider can render CROSS APPLY/OUTER APPLY or their lateral equivalent (CROSS JOIN LATERAL / LEFT JOIN LATERAL ... ON true). SQLite has no lateral source, so the safe default is false.

public virtual bool SupportsApply { get; }

Property Value

bool

SupportsApplyOnPlainTable

True when MakeApply(JoinType, string, KeywordCase) is valid over a plain physical table source. PostgreSQL and MySQL spell an applied source as ... LATERAL ..., and LATERAL is only allowed before a subquery, function or composite expression — not a bare table name — so they return false and a plain table is rendered as an ordinary CROSS/LEFT join instead. SQL Server spells it CROSS APPLY/OUTER APPLY, which accepts a table name, so it returns true. The default is false so a dialect without an opt-in never emits an invalid lateral reference.

public virtual bool SupportsApplyOnPlainTable { get; }

Property Value

bool

SupportsApproxCountDistinctAggregate

Defaults to false; SQL Server from major version 15 opts into APPROX_COUNT_DISTINCT.

public virtual bool SupportsApproxCountDistinctAggregate { get; }

Property Value

bool

SupportsApproxPercentileCont

Defaults to false; SQL Server from major version 16 opts into APPROX_PERCENTILE_CONT.

public virtual bool SupportsApproxPercentileCont { get; }

Property Value

bool

SupportsApproxPercentileDisc

Defaults to false; SQL Server from major version 16 opts into APPROX_PERCENTILE_DISC.

public virtual bool SupportsApproxPercentileDisc { get; }

Property Value

bool

SupportsArgMinMax

True when the provider can render the argMin(value, by)/argMax(value, by) aggregates. The safe default is false; ClickHouse opts in today.

public virtual bool SupportsArgMinMax { get; }

Property Value

bool

SupportsArrayAgg

True when the provider can render the array_agg(value) aggregate. Defaults to SupportsStringArrayAggregates; requires a provider with an array type.

public virtual bool SupportsArrayAgg { get; }

Property Value

bool

SupportsArrayFunctions

True when the provider has an array type and can render the array functions of ClickHouseFunctions over array columns (for example length, has, indexOf, arrayStringConcat, hasAny/hasAll, startsWith/endsWith/hasSubstr, arraySort, arrayReverse, arrayDistinct). The safe default is false; only ClickHouse opts in today.

public virtual bool SupportsArrayFunctions { get; }

Property Value

bool

SupportsArrayJoin

True when the provider can render arrayJoin(array), which expands one row per array element. The safe default is false; only ClickHouse opts in today. See array_join<T>(T[]).

public virtual bool SupportsArrayJoin { get; }

Property Value

bool

SupportsArrays

True when the provider has an array type and can render the array surface: array-typed parameters used with the any/all quantifiers (column = any(@array)) and the array functions in CommonFunctions. The safe default is false; only PostgreSQL opts in today.

public virtual bool SupportsArrays { get; }

Property Value

bool

SupportsBase64Decode

Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.

public virtual bool SupportsBase64Decode { get; }

Property Value

bool

SupportsBase64Encode

Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.

public virtual bool SupportsBase64Encode { get; }

Property Value

bool

SupportsBatch

Defaults to false; PostgreSQL, SQL Server, MySQL/MariaDB and SQLite opt into one-round-trip batches.

public virtual bool SupportsBatch { get; }

Property Value

bool

SupportsBitAggregates

True when the provider can render the bitwise aggregates bit_and, bit_or and bit_xor. The safe default is false; PostgreSQL and MySQL/MariaDB support them, but only PostgreSQL opts in today.

public virtual bool SupportsBitAggregates { get; }

Property Value

bool

SupportsBooleanAggregates

True when the provider can render the boolean aggregates bool_and, bool_or and every. The safe default is false; only PostgreSQL opts in today.

public virtual bool SupportsBooleanAggregates { get; }

Property Value

bool

SupportsBulkCopy

Defaults to false; PostgreSQL, SQL Server, MySQL/MariaDB and ClickHouse opt into a native bulk API.

public virtual bool SupportsBulkCopy { get; }

Property Value

bool

SupportsChecksumAggregate

Defaults to false; SQL Server opts into CHECKSUM_AGG.

public virtual bool SupportsChecksumAggregate { get; }

Property Value

bool

SupportsChoose

Defaults to false; only SQL Server opts into the choose conditional function.

public virtual bool SupportsChoose { get; }

Property Value

bool

SupportsCollation

True when the provider can attach a per-expression COLLATE clause (collate(string?, string?)). The safe default is false; SQL Server, PostgreSQL, MySQL/MariaDB and SQLite opt in, while ClickHouse has no COLLATE. Declared as a default interface method so that existing external implementations keep compiling.

public virtual bool SupportsCollation { get; }

Property Value

bool

SupportsColumnDefault

Defaults to false; PostgreSQL, SQL Server, MySQL and MariaDB accept DEFAULT as a value.

public virtual bool SupportsColumnDefault { get; }

Property Value

bool

SupportsCommandBehaviorSingleRow

True when passing SingleRow to the ADO.NET provider is safe. The ClickHouse driver translates that hint into an extra LIMIT 1 appended to the statement, which conflicts with the limit the dialect already renders for a single-row query, so ClickHouse opts out. The default is true.

public virtual bool SupportsCommandBehaviorSingleRow { get; }

Property Value

bool

SupportsCreateTableAsSelect

Defaults to false; PostgreSQL, SQLite, MySQL, MariaDB, ClickHouse and SQL Server can materialise a query into a table.

public virtual bool SupportsCreateTableAsSelect { get; }

Property Value

bool

SupportsCreateTableAsSelectColumnList

Defaults to false; PostgreSQL, MySQL and MariaDB accept a column list with AS SELECT; SQLite, SQL Server and ClickHouse do not.

public virtual bool SupportsCreateTableAsSelectColumnList { get; }

Property Value

bool

SupportsCreateTableAsSelectIfNotExists

Defaults to false; PostgreSQL, SQLite, MySQL, MariaDB and ClickHouse accept IF NOT EXISTS, SQL Server's SELECT ... INTO does not.

public virtual bool SupportsCreateTableAsSelectIfNotExists { get; }

Property Value

bool

SupportsCreateTableAsSelectOnCommit

Defaults to false; only PostgreSQL accepts ON COMMIT on a temporary table.

public virtual bool SupportsCreateTableAsSelectOnCommit { get; }

Property Value

bool

SupportsCreateTableAsSelectWithNoData

Defaults to false; only PostgreSQL accepts WITH [NO] DATA.

public virtual bool SupportsCreateTableAsSelectWithNoData { get; }

Property Value

bool

SupportsCrossDatabase

True when the provider can qualify a table with a database/schema name that differs from the current connection's default (SQL Server, MySQL, MariaDB, ClickHouse) or with an attached SQLite database. The safe default is false, so a WithDatabase override is rejected by the SQL builder on a dialect that did not opt in. Declared as a default interface method so that existing external implementations keep compiling.

public virtual bool SupportsCrossDatabase { get; }

Property Value

bool

SupportsCryptGenRandom

Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.

public virtual bool SupportsCryptGenRandom { get; }

Property Value

bool

SupportsCryptoFunctions

Only PostgreSQL has the digest/sha256 hash surface.

public virtual bool SupportsCryptoFunctions { get; }

Property Value

bool

SupportsCube

True when the provider can render GROUP BY CUBE (...). The safe default is false; MySQL/MariaDB have no CUBE, so they leave it off.

public virtual bool SupportsCube { get; }

Property Value

bool

SupportsDataModifyingCtes

Defaults to false; only PostgreSQL accepts a data-modifying statement (INSERT ... RETURNING) as a CTE body.

public virtual bool SupportsDataModifyingCtes { get; }

Property Value

bool

SupportsDateArithmetic

True when the provider can render the date arithmetic surface of CommonFunctions (date_add and end_of_month, also used for the DateTime.AddYears/ AddMonths/AddDays/... methods). The safe default is false; PostgreSQL, SQL Server and ClickHouse opt in today.

public virtual bool SupportsDateArithmetic { get; }

Property Value

bool

SupportsDateTimeOffsetTranslation

True when the dialect renders supported DateTimeOffset operations (Now/UtcNow, date parts and date arithmetic) as server-side SQL. When false (the default), those operations fail closed with NotSupportedException instead of being evaluated on the client, and MakeDateTimeOffsetNow(bool) also throws.

public virtual bool SupportsDateTimeOffsetTranslation { get; }

Property Value

bool

SupportsDateTrunc

True when the provider can render date_trunc with a date part name. The safe default is false; PostgreSQL and SQL Server 2022+ (datetrunc) opt in today.

public virtual bool SupportsDateTrunc { get; }

Property Value

bool

SupportsDefaultValues

Defaults to false; every SQL provider except ClickHouse opts into an all-defaults insert.

public virtual bool SupportsDefaultValues { get; }

Property Value

bool

SupportsDelete

Defaults to true; ClickHouse renders its ALTER TABLE ... DELETE mutation through MakeDeleteHead(string, KeywordCase).

public virtual bool SupportsDelete { get; }

Property Value

bool

SupportsDeleteJoin

Defaults to false; PostgreSQL, SQL Server, MySQL and MariaDB override it for native multi-table deletes.

public virtual bool SupportsDeleteJoin { get; }

Property Value

bool

SupportsDeleteJoinReturning

Defaults to false; only PostgreSQL returns the affected rows of a multi-table DELETE ... USING ... JOIN.

public virtual bool SupportsDeleteJoinReturning { get; }

Property Value

bool

SupportsDictionaries

Defaults to false; ClickHouse opts into the dictionary functions.

public virtual bool SupportsDictionaries { get; }

Property Value

bool

SupportsDirectApplyTableFunction

True when the provider accepts a table-valued function directly as the FROM source of an implicitly correlated join, so a bounded correlated APPLY over such a function can render the function itself instead of a derived wrapper (which would need a lateral keyword to correlate). MySQL and MariaDB correlate a function in FROM with the tables that precede it implicitly; every other dialect keeps its own APPLY spelling. The safe default is false.

public virtual bool SupportsDirectApplyTableFunction { get; }

Property Value

bool

SupportsExtendedScalarFunctions

True when the provider can render the extended scalar function library (SqlFunctions.Sql math/string/date/regular-expression and num_nulls/num_nonnulls helpers such as asin, split_part, lpad, regexp_replace, make_date, to_char). The safe default is false; only PostgreSQL opts in today.

public virtual bool SupportsExtendedScalarFunctions { get; }

Property Value

bool

SupportsFinal

Defaults to false; ClickHouse opts into the FINAL modifier.

public virtual bool SupportsFinal { get; }

Property Value

bool

SupportsForJson

True when the provider can render a trailing FOR JSON clause (SQL Server). The safe default is false; a command that carries one is rejected on a dialect that does not opt in.

public virtual bool SupportsForJson { get; }

Property Value

bool

SupportsForXml

True when the provider can render a trailing FOR XML clause (SQL Server). The safe default is false.

public virtual bool SupportsForXml { get; }

Property Value

bool

SupportsFullJoin

True when the provider can render full join. MySQL/MariaDB implement right join but not full join, so the two capabilities are separate.

public virtual bool SupportsFullJoin { get; }

Property Value

bool

SupportsFullText

True when the provider can render the full-text predicates contains and freetext (contains<T>(T?, string?)). The safe default is false; SQL Server opts in.

public virtual bool SupportsFullText { get; }

Property Value

bool

SupportsGlobalJoin

True when the provider understands the ClickHouse GLOBAL join modifier (the right-hand side is resolved once and broadcast). The safe default is false; only ClickHouse opts in.

public virtual bool SupportsGlobalJoin { get; }

Property Value

bool

SupportsGlobalPredicates

True when the provider supports the distributed GLOBAL IN predicate (SqlFunctions.ClickHouse.global_in). Defaults to false; ClickHouse opts in today.

public virtual bool SupportsGlobalPredicates { get; }

Property Value

bool

SupportsGreatestLeast

True when the provider can render greatest(...)/least(...). The safe default is false; PostgreSQL, MySQL/MariaDB, ClickHouse, SQL Server 2022+ and SQLite (through the scalar max/min) opt in.

public virtual bool SupportsGreatestLeast { get; }

Property Value

bool

SupportsGroupByWithTotals

Defaults to false; ClickHouse opts into the GROUP BY ... WITH TOTALS modifier.

public virtual bool SupportsGroupByWithTotals { get; }

Property Value

bool

SupportsGroupingIdAggregate

Defaults to false; SQL Server opts into GROUPING_ID.

public virtual bool SupportsGroupingIdAggregate { get; }

Property Value

bool

SupportsGroupingSets

True when the provider can render an explicit GROUP BY GROUPING SETS (...) list. The safe default is false; MySQL/MariaDB have no grouping sets, so they leave it off.

public virtual bool SupportsGroupingSets { get; }

Property Value

bool

SupportsHigherOrderArrayFunctions

True when the provider translates the higher-order (lambda) array functions of ClickHouseFunctions (arrayMap, arrayFilter, arrayExists, arrayAll, arrayCount, arrayFirst*, arrayLast*). The safe default is false; only ClickHouse opts in today. A provider with plain array functions may still lack lambda syntax, so this is separate from SupportsArrayFunctions.

public virtual bool SupportsHigherOrderArrayFunctions { get; }

Property Value

bool

SupportsIdentityFunction

Defaults to SupportsLastInsertId; SQL Server and PostgreSQL opt in explicitly.

public virtual bool SupportsIdentityFunction { get; }

Property Value

bool

SupportsInFrameWindowFunctions

Defaults to false; ClickHouse opts into the frame-respecting lagInFrame/leadInFrame.

public virtual bool SupportsInFrameWindowFunctions { get; }

Property Value

bool

SupportsInlineHints

True when the dialect folds the join/subquery/tables-in-scope hints into a statement-level inline comment (PostgreSQL pg_hint_plan, MySQL/MariaDB); the safe default is false.

public virtual bool SupportsInlineHints { get; }

Property Value

bool

SupportsInsertIgnore

Defaults to false; SQLite, MySQL, MariaDB and ClickHouse opt into an INSERT ... IGNORE head.

public virtual bool SupportsInsertIgnore { 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 virtual bool SupportsIntersectExceptAll { get; }

Property Value

bool

SupportsJoinHints

True when the dialect renders a join-level hint inside the join clause (SQL Server); the safe default is false.

public virtual bool SupportsJoinHints { get; }

Property Value

bool

SupportsJoinStrictness

True when the provider understands the join strictness/kind modifiers in JoinStrictness (ANY/ALL/ASOF). The safe default is false; only ClickHouse opts in.

public virtual bool SupportsJoinStrictness { get; }

Property Value

bool

SupportsJson

True when the provider has a native JSON storage type and can store a JsonColumnAttribute as it (rather than as text): the Auto/Native storage forms resolve to NativeJsonProviderType when this is true. The safe default is false; PostgreSQL and ClickHouse opt in today. This flag does not gate the PostgreSQL json/jsonb functions and operators — that surface is SupportsPostgresJsonSql.

public virtual bool SupportsJson { get; }

Property Value

bool

SupportsJsonExtract

Defaults to false; ClickHouse opts into the string-JSON JSONExtract* family and the native-JSON functions.

public virtual bool SupportsJsonExtract { get; }

Property Value

bool

SupportsLastInsertId

Defaults to false; MySQL/MariaDB opt into LAST_INSERT_ID().

public virtual bool SupportsLastInsertId { get; }

Property Value

bool

SupportsLinkedServer

True when the provider can qualify a table with a linked (remote) server name. The safe default is false (only SQL Server opts in), so a WithServer override is rejected by the SQL builder on a dialect that did not opt in. Declared as a default interface method so that existing external implementations keep compiling.

public virtual bool SupportsLinkedServer { get; }

Property Value

bool

SupportsMerge

Defaults to false; SQL Server opts into a key-upsert MERGE.

public virtual bool SupportsMerge { get; }

Property Value

bool

SupportsMergeBySourceDelete

Defaults to false; only SQL Server opts into WHEN NOT MATCHED BY SOURCE.

public virtual bool SupportsMergeBySourceDelete { get; }

Property Value

bool

SupportsMergeConditionalBranches

Defaults to false; SQL Server and PostgreSQL accept an explicit ON <condition> and WHEN ... AND <condition>.

public virtual bool SupportsMergeConditionalBranches { get; }

Property Value

bool

SupportsMergeDelete

Defaults to false; SQL Server and PostgreSQL opt into a WHEN MATCHED THEN DELETE branch.

public virtual bool SupportsMergeDelete { get; }

Property Value

bool

SupportsMergeDoNothing

Defaults to false; only PostgreSQL accepts THEN DO NOTHING (SQL Server has no such action).

public virtual bool SupportsMergeDoNothing { get; }

Property Value

bool

SupportsMergeStatement

Defaults to false; SQL Server and PostgreSQL 15+ opt into the general, multi-branch MERGE.

public virtual bool SupportsMergeStatement { get; }

Property Value

bool

SupportsMergeTargetQualification

Defaults to true; PostgreSQL overrides it because a MERGE target column must not be qualified.

public virtual bool SupportsMergeTargetQualification { get; }

Property Value

bool

SupportsNamedWindows

Defaults to false; PostgreSQL, MySQL, MariaDB, ClickHouse and SQLite opt into named windows.

public virtual bool SupportsNamedWindows { get; }

Property Value

bool

SupportsNativeDuration

Defaults to false; PostgreSQL, MySQL and MariaDB opt into a native duration type.

public virtual bool SupportsNativeDuration { get; }

Property Value

bool

SupportsNthValue

True when the provider can render the window function nth_value(value, n). The safe default is false; PostgreSQL, MySQL/MariaDB, SQLite and ClickHouse opt in, while SQL Server has no NTH_VALUE.

public virtual bool SupportsNthValue { get; }

Property Value

bool

SupportsNullsOrdering

True when the dialect understands the native NULLS FIRST/NULLS LAST modifier; the safe default is false, which selects the portable CASE emulation from RenderOrderBy(string, OrderDirection, NullsPosition). SQLite, PostgreSQL and ClickHouse opt in.

public virtual bool SupportsNullsOrdering { get; }

Property Value

bool

SupportsOnConflict

Defaults to false; PostgreSQL and SQLite 3.24+ opt into ON CONFLICT ... DO UPDATE.

public virtual bool SupportsOnConflict { get; }

Property Value

bool

SupportsOnConflictDoNothing

Defaults to false; PostgreSQL and SQLite opt into a trailing ON CONFLICT DO NOTHING.

public virtual bool SupportsOnConflictDoNothing { get; }

Property Value

bool

SupportsOnDuplicateKey

Defaults to false; MySQL and MariaDB opt into ON DUPLICATE KEY UPDATE.

public virtual bool SupportsOnDuplicateKey { get; }

Property Value

bool

SupportsOrderedAggregates

True when the provider can render the ordered-set aggregates percentile_cont/percentile_disc/mode with WITHIN GROUP (ORDER BY ...). The safe default is false; only PostgreSQL opts in today.

public virtual bool SupportsOrderedAggregates { get; }

Property Value

bool

SupportsOrderedPercentiles

Defaults to false; PostgreSQL opts into the ordered-set percentile/median form.

public virtual bool SupportsOrderedPercentiles { get; }

Property Value

bool

SupportsOrdinalComparison

True when the provider can express an ordinal (byte-order/binary) string comparison. The safe default is false; SQL Server, PostgreSQL, MySQL/MariaDB, SQLite and ClickHouse opt in. Declared as a default interface method so that existing external implementations keep compiling.

public virtual bool SupportsOrdinalComparison { get; }

Property Value

bool

SupportsOrdinalLike

True when the provider can make the case-sensitive ordinal overloads of the LIKE-family string methods (Contains/StartsWith/EndsWith with Ordinal) behave byte-wise. It defaults to SupportsOrdinalComparison; SQLite overrides it to false because its LIKE is always case-insensitive for ASCII regardless of the operand's collation, so a byte-order match cannot be expressed there and the call is rejected instead of being silently case-insensitive. The OrdinalIgnoreCase overloads are unaffected (they case-fold both operands).

public virtual bool SupportsOrdinalLike { get; }

Property Value

bool

SupportsOutput

Defaults to false; SQL Server opts into the OUTPUT clause.

public virtual bool SupportsOutput { get; }

Property Value

bool

SupportsOutputInto

Defaults to false; only SQL Server opts into OUTPUT ... INTO.

public virtual bool SupportsOutputInto { get; }

Property Value

bool

SupportsPasteJoin

True when the dialect understands the ClickHouse PASTE JOIN kind; the safe default is false.

public virtual bool SupportsPasteJoin { get; }

Property Value

bool

SupportsPercentRankCumeDist

True when the provider can render the window functions percent_rank() and cume_dist(). The safe default is false; PostgreSQL, SQL Server, MySQL/MariaDB, SQLite and ClickHouse opt in.

public virtual bool SupportsPercentRankCumeDist { get; }

Property Value

bool

SupportsPercentileWindow

Defaults to false; SQL Server and MariaDB opt into the window percentile functions.

public virtual bool SupportsPercentileWindow { get; }

Property Value

bool

SupportsPostgresJsonSql

Defaults to false; only PostgreSQL renders the JSON functions/operators surface.

public virtual bool SupportsPostgresJsonSql { get; }

Property Value

bool

SupportsPreWhere

Defaults to false; ClickHouse opts into the PREWHERE clause.

public virtual bool SupportsPreWhere { get; }

Property Value

bool

SupportsProductAggregate

True when the provider can render the PRODUCT(value) aggregate (product<T>(T?)). On SQL Server it follows SupportsSqlServer2025Functions because the aggregate arrived with 2025; the safe default is false. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsProductAggregate { get; }

Property Value

bool

SupportsQueryHints

True when the provider can render statement-level query hints (see Hints). The safe default is false; a command that carries hints is rejected by the SQL builder on a dialect that does not opt in.

public virtual bool SupportsQueryHints { get; }

Property Value

bool

SupportsRandomSeed

Only PostgreSQL has a standalone session random seed (setseed).

public virtual bool SupportsRandomSeed { get; }

Property Value

bool

SupportsRangeColumns

True when the provider can store a Range<T> as a pair of scalar columns declared with RangeColumnsAttribute; false by default. See SupportsRangeColumns.

public virtual bool SupportsRangeColumns { get; }

Property Value

bool

SupportsRanges

True when the provider has a native range type and can render the range surface: the Range<T> constructors/functions/operators on PostgresFunctions (overlaps, range_contains/range_contained_by, range_union, …). The safe default is false; only PostgreSQL opts in today. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsRanges { get; }

Property Value

bool

SupportsRawSqlSource

Defaults to false; every SQL provider overrides it to true (derived tables).

public virtual bool SupportsRawSqlSource { get; }

Property Value

bool

SupportsRecursiveCte

Defaults to true: the relational dialects can render a recursive CTE. ClickHouse has no recursive WITH and overrides this to false. The flag gates only the new typed recursive API, never a legacy WithRecursive declaration.

public virtual bool SupportsRecursiveCte { get; }

Property Value

bool

SupportsReferenceToCollectionNavigation

True when the provider can evaluate a collection reached through a declared reference navigation (for example child.Parent.Children) as a correlated subquery keyed off the reference-join alias. ClickHouse cannot correlate a subquery on a joined source, so it opts out and navigation expansion rejects the shape with a precise diagnostic instead of emitting an engine-level error. Defaults to true (declared as a default interface method so external implementations keep compiling).

public virtual bool SupportsReferenceToCollectionNavigation { get; }

Property Value

bool

SupportsRegex

True when the provider can translate a Regex call with a constant pattern into native SQL (Regex.IsMatch/Regex.Replace). The safe default is false; PostgreSQL, MySQL/MariaDB, ClickHouse, SQLite and SQL Server 2025+ opt in. On SQL Server the match renders as REGEXP_LIKE, which requires database compatibility level 170; REGEXP_REPLACE is available at every level. Declared as a default interface method so that existing external implementations keep compiling.

The compiled pattern follows the provider's own engine (RE2 on ClickHouse and SQL Server 2025, POSIX/ARE on PostgreSQL, ICU on MySQL, PCRE on MariaDB, .NET on SQLite), so a pattern is not portable in general: lookaround and backreferences are rejected by RE2, and the C# and SQL escaping rules differ. The CLR syntactic knowledge is not translated, only the operator/function choice.

public virtual bool SupportsRegex { get; }

Property Value

bool

SupportsRegressionAggregates

True when the provider can render the regression aggregates of the regr_ family (regr_slope, regr_intercept, regr_r2, regr_count, regr_avgx, regr_avgy). The safe default is false; only PostgreSQL opts in today. It is split from SupportsStatisticalAggregates so a provider that has corr/covar_ but no regr_* (ClickHouse) can opt into one without the other.

public virtual bool SupportsRegressionAggregates { get; }

Property Value

bool

SupportsReturning

Defaults to false; PostgreSQL and SQLite opt into the RETURNING clause.

public virtual bool SupportsReturning { get; }

Property Value

bool

SupportsRightFullJoin

True when the provider can render right join. A full join additionally requires SupportsFullJoin; they are separate because MySQL/MariaDB have one but not the other. SQLite before 3.39 cannot render either; this is expressed as a capability instead of being special-cased in the SQL builder.

public virtual bool SupportsRightFullJoin { get; }

Property Value

bool

SupportsRollup

True when the provider can render GROUP BY ROLLUP (...). The safe default is false; SQL Server, PostgreSQL, SQLite, MySQL/MariaDB and ClickHouse opt in (the latter group spells it ... WITH ROLLUP).

public virtual bool SupportsRollup { get; }

Property Value

bool

SupportsSample

Defaults to false; ClickHouse opts into the SAMPLE modifier.

public virtual bool SupportsSample { get; }

Property Value

bool

SupportsSavepoints

True when the provider supports savepoints inside an ADO.NET transaction; the fail-closed default is false, so a dialect opts in with an override. The member exists on the base class as well as on ISqlDialect because a class member declared in a derived type does not implement — and is not re-mapped to — an interface default member: without this virtual member a third-party dialect deriving from this base and declaring SupportsSavepoints => true would still read false through ISqlDialect.

public virtual bool SupportsSavepoints { get; }

Property Value

bool

SupportsSelectWhereMinMax

Defaults to false; every built-in dialect opts into SelectWhereMax/SelectWhereMin.

public virtual bool SupportsSelectWhereMinMax { get; }

Property Value

bool

SupportsSemiAntiJoin

True when the dialect understands the ClickHouse LEFT SEMI/LEFT ANTI join kinds; the safe default is false.

public virtual bool SupportsSemiAntiJoin { get; }

Property Value

bool

SupportsSequentialAccess

True when the provider supports SequentialAccess, which lets a LOB column be read incrementally through DbDataReader.GetStream/GetTextReader instead of being buffered whole. The safe default is false; PostgreSQL, SQL Server and SQLite opt in. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsSequentialAccess { get; }

Property Value

bool

SupportsSettings

Defaults to false; ClickHouse opts into the trailing SETTINGS clause.

public virtual bool SupportsSettings { get; }

Property Value

bool

SupportsSqlServer2022Functions

True when the provider is SQL Server and the declared server major version is 16 or later, so the 2022-only T-SQL functions (LEFT_SHIFT/RIGHT_SHIFT) can be rendered. The safe default is false, and an unversioned dialect refuses them. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsSqlServer2022Functions { get; }

Property Value

bool

SupportsSqlServer2025Functions

True when the provider is SQL Server and the declared server major version is 17 or later, so the 2025-only T-SQL functions (REGEXP_COUNT, REGEXP_SPLIT_TO_TABLE, PRODUCT) can be rendered. The safe default is false, and an unversioned dialect refuses them. The gate is version-only: unlike SupportsJson, an engine edition never substitutes for a declared major version. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsSqlServer2025Functions { get; }

Property Value

bool

SupportsStatisticalAggregates

True when the provider can render the statistical aggregates corr, covar_pop and covar_samp. The safe default is false; PostgreSQL and ClickHouse opt in today.

public virtual bool SupportsStatisticalAggregates { get; }

Property Value

bool

SupportsStoredProcedures

Defaults to false; SQL Server, PostgreSQL and MySQL/MariaDB opt into stored-procedure execution (CommandType.StoredProcedure).

public virtual bool SupportsStoredProcedures { get; }

Property Value

bool

SupportsStringAgg

True when the provider can render the string_agg(value, delimiter) aggregate. Defaults to SupportsStringArrayAggregates; SQL Server (2017+) opts in on its own.

public virtual bool SupportsStringAgg { get; }

Property Value

bool

SupportsStringArrayAggregates

True when the provider can render the string_agg/array_agg aggregate surface. The safe default is false; only PostgreSQL opts in today.

This is the umbrella capability: a dialect that opts into both aggregates sets it, and SupportsStringAgg/SupportsArrayAgg default to its value. A provider that supports only one of the two (SQL Server has string_agg but no array type) overrides the individual flag instead.

public virtual bool SupportsStringArrayAggregates { get; }

Property Value

bool

SupportsSubQueryHints

True when the dialect renders a subquery-level hint (inline-comment dialects); the safe default is false.

public virtual bool SupportsSubQueryHints { get; }

Property Value

bool

SupportsTableHints

True when the provider can render table-level hints on a physical FROM source (WITH (...)). The safe default is false; a command that carries table hints is rejected by the SQL builder on a dialect that does not opt in.

public virtual bool SupportsTableHints { get; }

Property Value

bool

SupportsTableValuedParameters

Defaults to false; SQL Server binds a table-valued parameter natively, PostgreSQL, MySQL/MariaDB and SQLite emulate it with a typed array or a JSON document, and ClickHouse with a bound Array(T)/Array(Tuple(...)) expanded with arrayJoin.

public virtual bool SupportsTableValuedParameters { get; }

Property Value

bool

SupportsTablesInScopeHints

True when the dialect renders a hint on every physical table in scope (SQL Server WITH (...)); the safe default is false.

public virtual bool SupportsTablesInScopeHints { get; }

Property Value

bool

SupportsTemporalTable

Defaults to false; SQL Server and MariaDB opt into FOR SYSTEM_TIME.

public virtual bool SupportsTemporalTable { get; }

Property Value

bool

SupportsTemporaryCreateTableAsSelect

Defaults to SupportsCreateTableAsSelect; only PostgreSQL, SQLite, MySQL and MariaDB keep a temporary form.

public virtual bool SupportsTemporaryCreateTableAsSelect { get; }

Property Value

bool

SupportsTextJson

True when the provider can render the JSON-as-text functions of CommonFunctions (json_value, json_query, json_modify, isjson), where JSON is stored in a normal text column rather than a native type. The safe default is false; SQL Server and MySQL/MariaDB opt in.

public virtual bool SupportsTextJson { get; }

Property Value

bool

SupportsTextSearchFunctions

Defaults to false; PostgreSQL opts into the native text-search scalar surface.

public virtual bool SupportsTextSearchFunctions { get; }

Property Value

bool

SupportsTransactions

True when the provider supports ADO.NET transactions on its connection (BEGIN/COMMIT/ROLLBACK). Declared as a default interface method returning true so existing external implementations keep compiling; only ClickHouse opts out, because its HTTP protocol has no transaction in the ADO.NET sense.

public virtual bool SupportsTransactions { get; }

Property Value

bool

SupportsTruncate

Defaults to false; SQLite has no TRUNCATE, so it keeps the default and callers use DELETE.

public virtual bool SupportsTruncate { get; }

Property Value

bool

SupportsTupleFunctions

True when the provider exposes the row-value surface: the constructor (PostgreSQL ROW(a, b), ClickHouse tuple(a, b)) built from Tuple.Create/new Tuple<...>/ new ValueTuple<...> and element access (from .ItemN). Equivalent to Tuple being non-null; declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsTupleFunctions { get; }

Property Value

bool

SupportsUpdate

Defaults to true; ClickHouse renders its ALTER TABLE ... UPDATE mutation through MakeUpdateHead(string, KeywordCase).

public virtual bool SupportsUpdate { get; }

Property Value

bool

SupportsUpdateJoin

Defaults to false; PostgreSQL, SQLite, SQL Server, MySQL and MariaDB override it for native multi-table updates.

public virtual bool SupportsUpdateJoin { get; }

Property Value

bool

SupportsUpdateJoinReturning

Defaults to false; only PostgreSQL returns the affected rows of a multi-table UPDATE ... FROM ... JOIN.

public virtual bool SupportsUpdateJoinReturning { get; }

Property Value

bool

SupportsUpdateReturning

Defaults to SupportsReturning; MariaDB gates UPDATE ... RETURNING on server version 13.0+.

public virtual bool SupportsUpdateReturning { get; }

Property Value

bool

SupportsWindowFrameExclusion

Defaults to false; PostgreSQL and SQLite opt into the frame EXCLUDE clause.

public virtual bool SupportsWindowFrameExclusion { get; }

Property Value

bool

SupportsWindowFrameGroups

Defaults to false; PostgreSQL, ClickHouse and SQLite opt into the GROUPS frame unit.

public virtual bool SupportsWindowFrameGroups { get; }

Property Value

bool

SupportsWithTies

Defaults to false; PostgreSQL and SQL Server opt into WITH TIES paging.

public virtual bool SupportsWithTies { get; }

Property Value

bool

TableSample

Defaults to null; PostgreSQL and SQL Server opt into TABLESAMPLE.

public virtual ITableSampleMethods? TableSample { get; }

Property Value

ITableSampleMethods

TopKAggregates

Defaults to null; ClickHouse opts into the topK/topKWeighted aggregates.

public virtual ITopKAggregateRenderer? TopKAggregates { get; }

Property Value

ITopKAggregateRenderer

Tuple

The provider's renderer for row values / composite tuples, or null when the provider has no row-value type (SQL Server) or does not expose it yet. Declared as a default interface method so existing external implementations keep compiling.

public virtual ITupleRenderer? Tuple { get; }

Property Value

ITupleRenderer

UniqAggregates

The provider's renderer for the ClickHouse distinct-count family; null means the provider cannot express it. Declared as a default interface method so that existing external implementations keep compiling.

public virtual IUniqAggregateRenderer? UniqAggregates { get; }

Property Value

IUniqAggregateRenderer

UpdateJoinRequiresFrom

Defaults to false; PostgreSQL and SQLite override it because their multi-table update uses the FROM spelling.

public virtual bool UpdateJoinRequiresFrom { get; }

Property Value

bool

UpdateRequiresWhere

Defaults to false; ClickHouse's ALTER TABLE ... UPDATE requires a WHERE clause.

public virtual bool UpdateRequiresWhere { get; }

Property Value

bool

UuidGenerators

Defaults to null; a provider with native UUID generators exposes its renderer.

public virtual IUuidGenerators? UuidGenerators { get; }

Property Value

IUuidGenerators

WrapsAverageResult

Whether the rendered avg expression must be wrapped so that an empty or all-NULL input yields SQL NULL. The default is false: every other provider already returns NULL there. ClickHouse returns nan/inf instead and overrides this to true.

public virtual bool WrapsAverageResult { get; }

Property Value

bool

WrapsCountResult

True when the provider's count aggregates return a type the row reader cannot materialise as a CLR integer, so the rendered count(...)/countIf(...) must be wrapped. Defaults to false; ClickHouse opts in because its count aggregates return UInt64.

public virtual bool WrapsCountResult { get; }

Property Value

bool

XmlFunctions

Defaults to null; only SQL Server opts into the postfix XML data-type methods.

public virtual IXmlFunctions? XmlFunctions { get; }

Property Value

IXmlFunctions

Methods

Escape(string)

Quotes an identifier (alias, keyword).

public virtual string Escape(string keyword)

Parameters

keyword string

Returns

string

GetPagingOrderBy(QueryCommand)

ORDER BY that paging has to inject for dialects that reject a page clause without sorting (SQL Server), or null when sorting is not required. Encoding the capability as a nullable result keeps the two pieces of the decision together and avoids a throwing default.

public virtual string? GetPagingOrderBy(QueryCommand queryCommand)

Parameters

queryCommand QueryCommand

Returns

string

IsSubDayField(string)

True for the date parts below a day, which need a fractional timestamp operand.

protected static bool IsSubDayField(string field)

Parameters

field string

Returns

bool

JoinTableQualifier(string?, string)

Joins an optional single qualifier (schema or, on a provider where they coincide, database) to a table name with the standard dot separator: qualifier.table, or table when the qualifier is null or empty.

protected static string JoinTableQualifier(string? qualifier, string table)

Parameters

qualifier string
table string

Returns

string

Kw(KeywordCase, string)

Resolves a lower-case keyword fragment (keywords and separators only) to the requested KeywordCase.

protected static string Kw(KeywordCase keywordCase, string text)

Parameters

keywordCase KeywordCase
text string

Returns

string

MakeAggregate(string)

Maps an aggregate function name to the provider specific one, e.g. stdev -> stddev.

public virtual string MakeAggregate(string name)

Parameters

name string

Returns

string

MakeApply(JoinType, string, KeywordCase)

Renders a lateral/apply source under applyType (CrossApply or OuterApply) over the already-rendered source. SQL Server emits cross apply/outer apply; providers that spell it as an ANSI lateral join emit cross join lateral/left join lateral ... on true.

public virtual string MakeApply(JoinType applyType, string source, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

applyType JoinType
source string
keywordCase KeywordCase

Returns

string

MakeArrayAgg(string)

Renders the array_agg(value) aggregate over the already-rendered argument.

public virtual string MakeArrayAgg(string value)

Parameters

value string

Returns

string

MakeArrayFunction(string, string)

Renders an array function call (ClickHouseFunctions) over the already-rendered call (for example length(tags)). The default returns the call verbatim; ClickHouse wraps length/indexOf in toInt64(...) because their native result is UInt64, which the row reader cannot materialise as the declared CLR integer.

public virtual string MakeArrayFunction(string name, string call)

Parameters

name string
call string

Returns

string

MakeArrayResult(string, string, Type)

Renders the result of an array-producing facade call over the already-rendered call, normalising it to the closed declared CLR resultType. name is the facade method name (for example group_array or range), never the provider's SQL spelling. The default is the identity: a dialect overrides this only when its native element type or nullability differs from the declared CLR array type (ClickHouse returns Array(UInt8) for retention and Array(Int64) for an arrayMap over int[]). The implementation must return exactly one expression and must not rewrite the call itself.

public virtual string MakeArrayResult(string name, string call, Type resultType)

Parameters

name string
call string
resultType Type

Returns

string

MakeAverageArgument(string, Type)

Renders the argument of an avg aggregate from its already-rendered form. The default is the identity; a dialect whose integer avg truncates widens an integral argument before the aggregation instead of casting the aggregate result. Applied to ordinary, distinct, filtered and window AVG, inside the parentheses and after distinct.

public virtual string MakeAverageArgument(string argument, Type inputType)

Parameters

argument string

The rendered argument expression.

inputType Type

The argument's CLR type (its nullable form included).

Returns

string

The argument text the aggregate receives.

MakeAverageResult(string, string, string?, string?)

Wraps a fully rendered avg expression so that an empty or all-NULL input yields SQL NULL (row eligibility, never the result value: a genuine NaN or infinity from non-empty data is kept). The default is the identity; only called when WrapsAverageResult is true. Applied to ordinary, distinct, filtered and window AVG after the aggregate (and its window clause) has been composed.

public virtual string MakeAverageResult(string aggregate, string argument, string? filterPredicate = null, string? windowClause = null)

Parameters

aggregate string

The fully rendered aggregate, including its filter or window clause.

argument string

The rendered value argument, as it appears inside the aggregate.

filterPredicate string

The rendered aggregate filter predicate, or null.

windowClause string

The rendered over ... window suffix, or null.

Returns

string

The expression to emit in place of aggregate.

MakeBase64Decode(string)

Defaults to the unsupported-provider exception; reached only when SupportsBase64Decode is true.

public virtual string MakeBase64Decode(string value)

Parameters

value string

Returns

string

MakeBase64Encode(string)

Defaults to the unsupported-provider exception; reached only when SupportsBase64Encode is true.

public virtual string MakeBase64Encode(string value)

Parameters

value string

Returns

string

MakeBool(bool)

Renders the SQL literal for a boolean value.

public virtual string MakeBool(bool v)

Parameters

v bool

Returns

string

MakeBoolCoalesce(string, string)

Coalesce over boolean operands. Dialects without a boolean type usable as a predicate (SQL Server) return an expression that is valid both as a value and as a condition.

public virtual string MakeBoolCoalesce(string v1, string v2)

Parameters

v1 string
v2 string

Returns

string

MakeBooleanPredicate(string, bool)

Renders a boolean-valued predicate. Dialects without a boolean type (SQL Server) materialise it as a bit scalar when it is used as a value instead of as a condition.

public virtual string MakeBooleanPredicate(string predicate, bool asPredicate)

Parameters

predicate string
asPredicate bool

Returns

string

MakeBooleanValuePredicate(string)

Renders a boolean value as a predicate. Dialects with a boolean type return the value unchanged; a dialect without one (SQL Server) has to compare it with its true literal, so that a bare boolean value (e.g. a bit column) can be used as a condition.

public virtual string MakeBooleanValuePredicate(string value)

Parameters

value string

Returns

string

MakeCase(string, bool, bool, KeywordCase)

Renders a provider-neutral case when ... then ... else ... end expression. isBooleanResult is true when the CASE yields a boolean value and asPredicate is true when it is used as a condition (WHERE/HAVING). Dialects with a real boolean type return the text unchanged; a dialect without one (SQL Server) has to materialise the integer result as a bit scalar and, in a condition context, compare it with 1 so that it stays valid both as a value and as a predicate.

public virtual string MakeCase(string caseExpression, bool isBooleanResult, bool asPredicate, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

caseExpression string
isBooleanResult bool
asPredicate bool
keywordCase KeywordCase

Returns

string

MakeCoalesce(string, string)

Renders coalesce(v1, v2) over the already-rendered operands.

public virtual string MakeCoalesce(string v1, string v2)

Parameters

v1 string
v2 string

Returns

string

MakeCollate(string, string, KeywordCase)

Renders value COLLATE collation over the already-rendered value. collation is the provider-native collation name, quoted where the provider requires it (PostgreSQL). Only called when SupportsCollation is true.

public virtual string MakeCollate(string value, string collation, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

value string
collation string
keywordCase KeywordCase

Returns

string

MakeColumnAlias(string?, KeywordCase)

Renders the alias clause for a projected column (AS alias); a null or empty colAlias renders nothing.

public virtual string MakeColumnAlias(string? colAlias, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

colAlias string
keywordCase KeywordCase

Returns

string

MakeColumnDefault(KeywordCase)

Renders the DEFAULT keyword as a value; only reached through a dialect that set SupportsColumnDefault.

public virtual string MakeColumnDefault(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeColumnReference(string)

Quotes a column alias when it is referenced from an outer query. Providers that emit quoted aliases (so they survive as case-sensitive identifiers) must quote the reference accordingly.

public virtual string MakeColumnReference(string name)

Parameters

name string

Returns

string

MakeConcat(IReadOnlyList<string>)

Renders a string concatenation over the already-rendered operands. Dialects whose infix operator concatenates (SQLite, PostgreSQL, SQL Server) join the parts with ConcatStringOperator; dialects where that operator means something else or does not exist (MySQL/MariaDB, ClickHouse) render the concat function instead.

public virtual string MakeConcat(IReadOnlyList<string> parts)

Parameters

parts IReadOnlyList<string>

Returns

string

MakeCount(bool, bool)

Renders the opening fragment of a count aggregate. big requests a 64-bit count; dialects where count already returns a 64-bit integer ignore the flag.

public virtual string MakeCount(bool distinct, bool big)

Parameters

distinct bool
big bool

Returns

string

MakeCreateTableAsHead(CreateTableAsClause, KeywordCase)

Renders the head of a CREATE ... TABLE ... up to (but not including) AS <select>: the temporary modifier, IF NOT EXISTS, the resolved table and the optional column list.

protected virtual string MakeCreateTableAsHead(CreateTableAsClause clause, KeywordCase keywordCase)

Parameters

clause CreateTableAsClause

The resolved clause options.

keywordCase KeywordCase

The letter case in which SQL keywords are emitted.

Returns

string

The rendered statement head.

MakeCreateTableAsSelect(CreateTableAsClause, string, KeywordCase)

Renders the ANSI/CLI CREATE [TEMPORARY] TABLE [IF NOT EXISTS] <t> [(cols)] AS <select> form by composing MakeCreateTableAsHead(CreateTableAsClause, KeywordCase) and MakeCreateTableAsTail(CreateTableAsClause, KeywordCase). Only reached through a dialect that set SupportsCreateTableAsSelect; PostgreSQL overrides just those two seams to add ON COMMIT and WITH [NO] DATA.

public virtual string MakeCreateTableAsSelect(CreateTableAsClause clause, string selectSql, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

clause CreateTableAsClause
selectSql string
keywordCase KeywordCase

Returns

string

MakeCreateTableAsSelectInto(CreateTableAsClause, KeywordCase)

Renders the clause that introduces the target of a SELECT ... INTO materialisation, inserted into the select list by the statement builder. Only reached through a dialect that set CreateTableAsSelectUsesSelectInto.

public virtual string MakeCreateTableAsSelectInto(CreateTableAsClause clause, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

clause CreateTableAsClause
keywordCase KeywordCase

Returns

string

MakeCreateTableAsTail(CreateTableAsClause, KeywordCase)

Renders the tail appended after the body query. The base returns nothing; PostgreSQL overrides it to emit WITH NO DATA.

protected virtual string MakeCreateTableAsTail(CreateTableAsClause clause, KeywordCase keywordCase)

Parameters

clause CreateTableAsClause

The resolved clause options.

keywordCase KeywordCase

The letter case in which SQL keywords are emitted.

Returns

string

The rendered statement tail.

MakeCryptGenRandom(string)

Defaults to the unsupported-provider exception; reached only when SupportsCryptGenRandom is true.

public virtual string MakeCryptGenRandom(string length)

Parameters

length string

Returns

string

MakeDateAdd(string, string, string)

Renders date addition (value + amount of field) over the already-rendered arguments; field is a validated date-part name.

public virtual string MakeDateAdd(string field, string amount, string value)

Parameters

field string
amount string
value string

Returns

string

MakeDateAdd(string, string, string, bool)

Renders DateTimeOffset date addition. A provider whose native date-add needs DateTimeOffset-specific adaptation (timezone normalization, fractional scaling, preserving the offset) overrides this; the default delegates to MakeDateAdd(string, string, string). field is a validated date-part name.

public virtual string MakeDateAdd(string field, string amount, string value, bool isDateTimeOffset)

Parameters

field string
amount string
value string
isDateTimeOffset bool

Returns

string

MakeDateDiff(string, string, string)

Renders the difference between two already-rendered timestamps in field units; field is a validated date-part name.

public virtual string MakeDateDiff(string field, string start, string end)

Parameters

field string
start string
end string

Returns

string

MakeDateDiffBig(string, string, string)

Renders the same difference as MakeDateDiff(string, string, string) through a 64-bit result, so a millisecond/microsecond span does not overflow (the date_diff_big function). The default delegates to MakeDateDiff(string, string, string), whose result is already 64-bit on most providers; SQL Server overrides it with datediff_big.

public virtual string MakeDateDiffBig(string field, string start, string end)

Parameters

field string
start string
end string

Returns

string

MakeDateDiffCore(string, string, string, bool)

Renders the ANSI/PostgreSQL difference, widening the sub-day result when big.

protected string MakeDateDiffCore(string field, string start, string end, bool big)

Parameters

field string
start string
end string
big bool

Returns

string

MakeDateFromParts(string, string, string)

Renders a date built from its already-rendered year/month/ day parts.

public virtual string MakeDateFromParts(string year, string month, string day)

Parameters

year string
month string
day string

Returns

string

MakeDatePart(string, string)

Renders a date/time part extraction (year, month, day, hour, ...).

public virtual string MakeDatePart(string part, string value)

Parameters

part string
value string

Returns

string

MakeDatePart(string, string, bool)

Renders a date/time part extraction for a DateTimeOffset value. A provider whose native date parts follow the session time zone overrides this to normalize to UTC first; the default delegates to MakeDatePart(string, string). part is a validated date-part name.

public virtual string MakeDatePart(string part, string value, bool isDateTimeOffset)

Parameters

part string
value string
isDateTimeOffset bool

Returns

string

MakeDateTimeOffsetNow(bool)

Renders the server-side current DateTimeOffset: the value is produced by the database (never the client clock), either with a preserved offset or as the provider's canonical offset-zero instant. A dialect that declares SupportsDateTimeOffsetTranslation overrides this; the default fails closed.

public virtual string MakeDateTimeOffsetNow(bool utc)

Parameters

utc bool

Returns

string

MakeDateTrunc(string, string)

Renders date_trunc(field, value); field is a validated date-part name.

public virtual string MakeDateTrunc(string field, string value)

Parameters

field string
value string

Returns

string

MakeDefaultValues(KeywordCase)

Renders the all-defaults row form; MySQL/MariaDB override it with () VALUES ().

public virtual string MakeDefaultValues(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeDeleteHead(string, KeywordCase)

Renders the delete head; defaults to the ANSI DELETE FROM <table>.

public virtual string MakeDeleteHead(string table, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

table string
keywordCase KeywordCase

Returns

string

MakeDeleteJoin(string, string, string, string, string, string?, KeywordCase)

Renders the alias-style multi-table delete (DELETE <alias> FROM <target> AS alias JOIN ... WHERE ...), shared by SQL Server, MySQL and MariaDB. PostgreSQL overrides it with the USING form.

public virtual string MakeDeleteJoin(string target, string targetAlias, string fromAndJoins, string usingSources, string joinConditions, string? whereSql, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

target string
targetAlias string
fromAndJoins string
usingSources string
joinConditions string
whereSql string
keywordCase KeywordCase

Returns

string

MakeDeleteSuffix(KeywordCase)

Renders a suffix appended after the delete's filter; defaults to none.

public virtual string? MakeDeleteSuffix(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeDeletedOutput(IReadOnlyList<string>, KeywordCase)

Renders OUTPUT deleted.<column> ... for a DELETE; only reached through a dialect that set SupportsOutput.

public virtual string MakeDeletedOutput(IReadOnlyList<string> columns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeDeletedOutputInto(IReadOnlyList<string>, string, IReadOnlyList<string>, KeywordCase)

Renders the OUTPUT deleted.<columns> INTO <target>(columns) clause of a DELETE; only reached through a dialect that set SupportsOutputInto.

public virtual string MakeDeletedOutputInto(IReadOnlyList<string> columns, string target, IReadOnlyList<string> targetColumns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
target string
targetColumns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeDictionaryFunction(string, IReadOnlyList<string>)

Renders name(args); ClickHouse maps the snake_case name to its camel-case spelling.

public virtual string MakeDictionaryFunction(string name, IReadOnlyList<string> args)

Parameters

name string
args IReadOnlyList<string>

Returns

string

MakeDurationType(DurationUnit?, int)

Non-native providers store a duration in a bigint; a native provider overrides this with its interval/time type.

public virtual string MakeDurationType(DurationUnit? unit, int precision = 0)

Parameters

unit DurationUnit?
precision int

Returns

string

MakeEndOfMonth(string)

Renders the last day of the month of the already-rendered value.

public virtual string MakeEndOfMonth(string value)

Parameters

value string

Returns

string

MakeFilteredStringAgg(string, string, string)

Renders a filtered string_agg for a dialect whose AggregateFilterStyle is IfCombinator, composing the already-rendered predicate into the aggregate. The default throws; a dialect that expresses the ANSI clause handles the filter through the shared filter helper instead.

public virtual string MakeFilteredStringAgg(string value, string delimiter, string predicate)

Parameters

value string
delimiter string
predicate string

Returns

string

MakeFinal(KeywordCase)

Renders the FINAL modifier; ClickHouse places it right after the table.

public virtual string MakeFinal(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeForJson(ForJsonClause, KeywordCase)

Renders the trailing FOR JSON clause for clause. Only called when SupportsForJson is true.

public virtual string MakeForJson(ForJsonClause clause, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

clause ForJsonClause
keywordCase KeywordCase

Returns

string

MakeForXml(ForXmlClause, KeywordCase)

Renders the trailing FOR XML clause for clause. Only called when SupportsForXml is true.

public virtual string MakeForXml(ForXmlClause clause, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

clause ForXmlClause
keywordCase KeywordCase

Returns

string

MakeFullText(string, string, string)

Renders the full-text predicate functionName (contains/freetext) over the already-rendered column and search operands. Only called when SupportsFullText is true.

public virtual string MakeFullText(string functionName, string column, string search)

Parameters

functionName string
column string
search string

Returns

string

MakeFunction(string, string?)

Renders a user-defined scalar function name (SqlFunctionAttribute), optionally schema/owner qualified. The default is the verbatim name; a dialect may override it to quote or remap the identifier.

public virtual string MakeFunction(string name, string? schema)

Parameters

name string
schema string

Returns

string

MakeGreatest(IReadOnlyList<string>)

Renders greatest(...) over the already-rendered arguments.

public virtual string MakeGreatest(IReadOnlyList<string> args)

Parameters

args IReadOnlyList<string>

Returns

string

MakeGroupByTotals(string, KeywordCase)

Returns the grouping clause unchanged; ClickHouse appends with totals.

public virtual string MakeGroupByTotals(string grouping, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

grouping string
keywordCase KeywordCase

Returns

string

MakeGrouping(string, GroupingType, KeywordCase)

Renders a grouping list with the given super-aggregate groupingType over the already-rendered, comma-separated columns. The default is the ANSI rollup (columns)/cube (columns) form; a provider that spells it columns WITH ROLLUP overrides this.

public virtual string MakeGrouping(string columns, GroupingType groupingType, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns string
groupingType GroupingType
keywordCase KeywordCase

Returns

string

MakeGroupingSets(IReadOnlyList<string>, KeywordCase)

Renders GROUPING SETS (...) over the already-rendered, parenthesised groupingSets (each entry is a returned (a, b)/() string).

public virtual string MakeGroupingSets(IReadOnlyList<string> groupingSets, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

groupingSets IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeIdentityFunction(KeywordCase)

Renders the scalar query for the last generated identity without naming the column; only reached through a dialect that set SupportsIdentityFunction.

public virtual string MakeIdentityFunction(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeIdentityInsertOff(string, KeywordCase)

Renders the statement that disables explicit identity values for a table; only reached through a dialect that set RequiresIdentityInsertToggle.

public virtual string MakeIdentityInsertOff(string table, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

table string
keywordCase KeywordCase

Returns

string

MakeIdentityInsertOn(string, KeywordCase)

Renders the statement that enables explicit identity values for a table; only reached through a dialect that set RequiresIdentityInsertToggle.

public virtual string MakeIdentityInsertOn(string table, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

table string
keywordCase KeywordCase

Returns

string

MakeInsertIgnoreInto(KeywordCase)

Renders the INSERT head that skips conflicting rows; MySQL/MariaDB override it with insert ignore into .

public virtual string MakeInsertIgnoreInto(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeIsJson(string, bool)

Renders the text-JSON validity test over the already-rendered value. When asPredicate is true the result is a boolean predicate, otherwise a value expression. Only called when SupportsTextJson is true.

public virtual string MakeIsJson(string value, bool asPredicate)

Parameters

value string
asPredicate bool

Returns

string

MakeJoinKeyword(JoinType, JoinStrictness, bool, KeywordCase)

Renders the join keyword for joinType with an optional JoinStrictness modifier and/or the GLOBAL modifier. A dialect that did not opt in with SupportsJoinStrictness/SupportsGlobalJoin is only ever asked for Default and false. The ClickHouse-only Semi/Anti/Paste kinds are only requested from a dialect that opted in with SupportsSemiAntiJoin/SupportsPasteJoin.

public virtual string MakeJoinKeyword(JoinType joinType, JoinStrictness strictness, bool isGlobal, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

joinType JoinType
strictness JoinStrictness
isGlobal bool
keywordCase KeywordCase

Returns

string

MakeJoinKeyword(JoinType, JoinStrictness, bool, string?, KeywordCase)

Renders the join keyword for joinType with an optional join-level hint placed per the provider's syntax (SQL Server inserts it before the JOIN keyword, e.g. inner loop join). Only called with a non-null hint when SupportsJoinHints is true; the base implementation throws, so a dialect that did not opt in never emits an unsupported hint. When hint is null this delegates to MakeJoinKeyword(JoinType, JoinStrictness, bool, KeywordCase).

public virtual string MakeJoinKeyword(JoinType joinType, JoinStrictness strictness, bool isGlobal, string? hint, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

joinType JoinType
strictness JoinStrictness
isGlobal bool
hint string
keywordCase KeywordCase

Returns

string

MakeJsonExtract(string, IReadOnlyList<string>)

Renders name(args); ClickHouse maps the snake_case name to its native spelling and casts unsigned results.

public virtual string MakeJsonExtract(string name, IReadOnlyList<string> args)

Parameters

name string
args IReadOnlyList<string>

Returns

string

MakeLastInsertId(KeywordCase)

Renders the scalar query for the last generated identity; only reached through a dialect that set SupportsLastInsertId.

public virtual string MakeLastInsertId(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeLeast(IReadOnlyList<string>)

Renders least(...) over the already-rendered arguments.

public virtual string MakeLeast(IReadOnlyList<string> args)

Parameters

args IReadOnlyList<string>

Returns

string

MakeLikeEscape(string, KeywordCase)

Renders the escape clause of a LIKE predicate for escapeChar. The literal form differs per provider (MySQL requires a doubled backslash to escape the string delimiter), so the escaping is delegated to the dialect.

public virtual string MakeLikeEscape(string escapeChar, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

escapeChar string
keywordCase KeywordCase

Returns

string

MakeLower(string)

Renders a lower case conversion.

public virtual string MakeLower(string value)

Parameters

value string

Returns

string

MakeMathFunction(string, IReadOnlyList<string>)

Renders a math function call with the given already-rendered arguments.

public virtual string MakeMathFunction(string name, IReadOnlyList<string> args)

Parameters

name string
args IReadOnlyList<string>

Returns

string

MakeMathFunction(string, IReadOnlyList<string>, IReadOnlyList<Type>)

Renders a math function call, receiving the static CLR argument types for dialects whose native function has a narrower overload set than ANSI. The default ignores the types and delegates to MakeMathFunction(string, IReadOnlyList<string>).

public virtual string MakeMathFunction(string name, IReadOnlyList<string> args, IReadOnlyList<Type> argTypes)

Parameters

name string
args IReadOnlyList<string>
argTypes IReadOnlyList<Type>

Returns

string

MakeMaxRecursion(int, KeywordCase)

Renders the statement-level option that raises the recursion limit (SQL Server option (maxrecursion n)), or null when the dialect has no such option and relies on its own default (SQLite, PostgreSQL).

public virtual string? MakeMaxRecursion(int maxRecursion, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

maxRecursion int
keywordCase KeywordCase

Returns

string

MakeMerge(string, IReadOnlyList<string>, IReadOnlyList<string>, IReadOnlyList<string>, string, KeywordCase, IReadOnlyList<string>?)

Renders a key-upsert MERGE; only reached through a dialect that set SupportsMerge.

public virtual string MakeMerge(string target, IReadOnlyList<string> columns, IReadOnlyList<string> keys, IReadOnlyList<string> updateColumns, string valuesRows, KeywordCase keywordCase = KeywordCase.Lower, IReadOnlyList<string>? returningColumns = null)

Parameters

target string
columns IReadOnlyList<string>
keys IReadOnlyList<string>
updateColumns IReadOnlyList<string>
valuesRows string
keywordCase KeywordCase
returningColumns IReadOnlyList<string>

Returns

string

MakeMergeReturning(IReadOnlyList<string>, KeywordCase)

Renders the RETURNING clause of a general MERGE. Defaults to the ANSI form; PostgreSQL overrides it to qualify the target columns, whose names would otherwise be ambiguous with the source.

public virtual string MakeMergeReturning(IReadOnlyList<string> columns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeMergeStatementTerminator(KeywordCase)

Renders the terminator of a general MERGE; defaults to none, SQL Server requires ;.

public virtual string MakeMergeStatementTerminator(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeNow(bool)

Renders the current local or UTC date/time.

public virtual string MakeNow(bool utc)

Parameters

utc bool

Returns

string

MakeNullIf(string, string)

Renders nullif(value, other). ANSI and portable, so every dialect accepts it.

public virtual string MakeNullIf(string value, string other)

Parameters

value string
other string

Returns

string

MakeNullableDurationType(DurationUnit?, int)

Renders the column type of a nullable TimeSpan property. The default returns MakeDurationType(DurationUnit?, int) because the native types and the integer columns of most providers already admit SQL NULL; ClickHouse, whose Int64 is not nullable, overrides it with Nullable(...). Declared as a default interface method so that existing external implementations keep compiling.

public virtual string MakeNullableDurationType(DurationUnit? unit, int precision = 0)

Parameters

unit DurationUnit?

The declared storage unit, or null.

precision int

The fractional-second precision of the native type; zero for the provider default.

Returns

string

The SQL type name.

MakeOnConflict(IReadOnlyList<string>, KeywordCase)

Renders ON CONFLICT (<keys>) DO UPDATE SET ; only reached through a dialect that set SupportsOnConflict.

public virtual string MakeOnConflict(IReadOnlyList<string> keys, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keys IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeOnConflictDoNothing(KeywordCase)

Renders the trailing ON CONFLICT DO NOTHING; only reached through a dialect that set SupportsOnConflictDoNothing.

public virtual string MakeOnConflictDoNothing(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeOnDuplicateKey(KeywordCase)

Renders ON DUPLICATE KEY UPDATE ; only reached through a dialect that set SupportsOnDuplicateKey.

public virtual string MakeOnDuplicateKey(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeOnesComplement(string)

Renders the integer ones-complement (~) over the already-rendered operand. MySQL's ~ yields an unsigned 64-bit result, so a dialect whose integer complement must stay signed overrides this.

public virtual string MakeOnesComplement(string operand)

Parameters

operand string

Returns

string

MakeOrdinal(string, bool)

Renders a string operand normalised for ordinal comparison. A provider with a per-expression binary collation emits value COLLATE <binary>; a provider whose native String order is already ordinal (ClickHouse) returns the value unchanged. ignoreCase additionally case-folds the operand. Only called when SupportsOrdinalComparison is true.

public virtual string MakeOrdinal(string value, bool ignoreCase)

Parameters

value string
ignoreCase bool

Returns

string

MakeOutput(IReadOnlyList<string>, KeywordCase)

Renders OUTPUT inserted.<column>; only reached through a dialect that set SupportsOutput.

public virtual string MakeOutput(IReadOnlyList<string> columns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeOutputInto(IReadOnlyList<string>, string, IReadOnlyList<string>, KeywordCase)

Renders the OUTPUT inserted.<columns> INTO <target>(columns) clause; only reached through a dialect that set SupportsOutputInto.

public virtual string MakeOutputInto(IReadOnlyList<string> columns, string target, IReadOnlyList<string> targetColumns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
target string
targetColumns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeOverridingSystemValue(KeywordCase)

Renders the PostgreSQL OVERRIDING SYSTEM VALUE clause; the empty string on dialects that need no clause.

public virtual string MakeOverridingSystemValue(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakePad(string, string, string, bool)

Renders a left/right pad of value to length with the single-character literal pad. Matches PadLeft(int): a value that is already at least length long is returned unchanged (the SQL lpad/rpad family truncates, so the length is guarded).

public virtual string MakePad(string value, string length, string pad, bool left)

Parameters

value string
length string
pad string
left bool

Returns

string

MakePage(Paging, StringBuilder, KeywordCase)

Appends the provider's paging clause (LIMIT/OFFSET, OFFSET/FETCH or TOP) for paging to sqlBuilder.

public abstract void MakePage(Paging paging, StringBuilder sqlBuilder, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

paging Paging
sqlBuilder StringBuilder
keywordCase KeywordCase

MakeParam(string)

Renders a parameter placeholder, e.g. @name or $name.

public abstract string MakeParam(string name)

Parameters

name string

Returns

string

MakeQualifiedTableName(string?, string?, string?, string)

Renders a possibly qualified table name from its parts, omitting the parts that are null. The base implementation renders schema.table and rejects the server/database levels; a dialect that opted in with SupportsCrossDatabase/SupportsLinkedServer overrides it to place the supported levels (SQL Server server.database.schema.table, MySQL/MariaDB/ClickHouse/SQLite a single database.table qualifier). Reached only for the levels the provider supports.

public virtual string MakeQualifiedTableName(string? server, string? database, string? schema, string table)

Parameters

server string

The linked-server name, or null.

database string

The database name, or null.

schema string

The schema name, or null.

table string

The unqualified table name.

Returns

string

The qualified table name (unquoted).

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 virtual 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 virtual string MakeRegexReplace(string value, string pattern, string replacement, bool ignoreCase)

Parameters

value string
pattern string
replacement string
ignoreCase bool

Returns

string

MakeRepeat(string, string)

Renders value repeated count times. The primitive behind the new string(char, n) translation and MakePad(string, string, string, bool).

public virtual string MakeRepeat(string value, string count)

Parameters

value string
count string

Returns

string

MakeReplace(string, string, string)

Renders a string replace.

public virtual string MakeReplace(string value, string oldValue, string newValue)

Parameters

value string
oldValue string
newValue string

Returns

string

MakeResultColumnType(Type, bool)

Renders a result-schema column type by unwrapping the nullable CLR type and delegating to MakeTypeName(Type).

public virtual string MakeResultColumnType(Type clrType, bool nullable)

Parameters

clrType Type
nullable bool

Returns

string

MakeReturning(IReadOnlyList<string>, KeywordCase)

Renders RETURNING <columns>; only reached through a dialect that set SupportsReturning.

public virtual string MakeReturning(IReadOnlyList<string> columns, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

columns IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeSample(double, double, KeywordCase)

Renders the SAMPLE ratio [OFFSET offset] modifier.

public virtual string MakeSample(double ratio, double offset, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

ratio double
offset double
keywordCase KeywordCase

Returns

string

MakeSettings(IReadOnlyList<KeyValuePair<string, string>>, KeywordCase)

Renders the trailing SETTINGS key = value, ... clause.

public virtual string MakeSettings(IReadOnlyList<KeyValuePair<string, string>> settings, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

settings IReadOnlyList<KeyValuePair<string, string>>
keywordCase KeywordCase

Returns

string

MakeStringAgg(string, string)

Renders the string_agg(value, delimiter) aggregate over the already-rendered arguments.

public virtual string MakeStringAgg(string value, string delimiter)

Parameters

value string
delimiter string

Returns

string

MakeStringIndexOf(string, string, string?)

Renders the zero-based index of the first occurrence of substring in value, or -1 when it is absent, matching IndexOf(string). start, when not null, is the already-rendered zero-based index the search starts at.

public virtual string MakeStringIndexOf(string value, string substring, string? start)

Parameters

value string
substring string
start string

Returns

string

MakeStringLastIndexOf(string, string)

Renders the zero-based index of the last occurrence of substring in value, or -1 when it is absent, matching LastIndexOf(string). A provider without a character-wise reversal fails with a clear message.

public virtual string MakeStringLastIndexOf(string value, string substring)

Parameters

value string
substring string

Returns

string

MakeStringLength(string)

Renders a string length function over value (SQL Server len, others length).

public virtual string MakeStringLength(string value)

Parameters

value string

Returns

string

MakeStringPosition(string, string)

Renders the one-based position of substring in value, or 0 when it is absent (charindex, instr, strpos, position).

protected virtual string MakeStringPosition(string value, string substring)

Parameters

value string
substring string

Returns

string

MakeStringPosition(string, string, string)

Renders the one-based position of substring in value starting at the already-rendered zero-based start. The default composes the two-argument primitive over the tail; a dialect with a native start argument overrides it.

protected virtual string MakeStringPosition(string value, string substring, string start)

Parameters

value string
substring string
start string

Returns

string

MakeStringReverse(string)

Renders a character-wise reversal of value.

protected virtual string MakeStringReverse(string value)

Parameters

value string

Returns

string

MakeStuff(string, string, string?, string)

Renders Remove(int)/Remove(int, int) and Insert(int, string) as one stuff/overlay-style expression over the already-rendered zero-based start. A count of null removes through the end; newValue is spliced in at start otherwise (the Insert translation passes the string "0" so nothing is removed).

public virtual string MakeStuff(string value, string start, string? count, string newValue)

Parameters

value string
start string
count string
newValue string

Returns

string

MakeSubqueryPredicate(string, string, bool)

Renders a subquery predicate (exists/any/all). asPredicate is true when the expression is used as a condition (WHERE/HAVING) rather than as a projected value; a dialect without a boolean type (SQL Server) has to render the two forms differently.

public virtual string MakeSubqueryPredicate(string keyword, string query, bool asPredicate)

Parameters

keyword string
query string
asPredicate bool

Returns

string

MakeSubstring(string, string, string?)

Renders a substring. start is the zero-based C# index; the dialect adds the one-based offset and, when length is null, derives the remaining length.

public virtual string MakeSubstring(string value, string start, string? length)

Parameters

value string
start string
length string

Returns

string

MakeTableAlias(string, KeywordCase)

Renders the alias clause for a table source (AS alias).

public virtual string MakeTableAlias(string tableAlias, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

tableAlias string
keywordCase KeywordCase

Returns

string

MakeTableFunctionAlias(string, string?, KeywordCase)

Defaults to the plain table alias; PostgreSQL appends the column-definition list.

public virtual string MakeTableFunctionAlias(string tableAlias, string? columnDefinitionList, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

tableAlias string
columnDefinitionList string
keywordCase KeywordCase

Returns

string

MakeTableHints(IReadOnlyList<string>, KeywordCase)

Renders the table-level hint clause appended to a physical table name, or an empty string when the dialect has no table hints. Only called when SupportsTableHints is true and hints is non-empty.

public virtual string MakeTableHints(IReadOnlyList<string> hints, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

hints IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeTablesInScopeHints(IReadOnlyList<string>, KeywordCase)

Renders the tables-in-scope hints appended to a physical table name (SQL Server WITH (...)). Only called when SupportsTablesInScopeHints is true and the hints are non-empty.

public virtual string MakeTablesInScopeHints(IReadOnlyList<string> hints, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

hints IReadOnlyList<string>
keywordCase KeywordCase

Returns

string

MakeTemporalTable(TemporalClause, KeywordCase)

Renders the SQL:2011 FOR SYSTEM_TIME clause (shared by SQL Server and MariaDB). Only reached through a dialect that set SupportsTemporalTable.

public virtual string MakeTemporalTable(TemporalClause clause, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

clause TemporalClause
keywordCase KeywordCase

Returns

string

MakeTextJsonFunction(string)

Maps a text-JSON function name (json_value/json_query/json_modify) to the provider's spelling. Only called when SupportsTextJson is true.

public virtual string MakeTextJsonFunction(string name)

Parameters

name string

Returns

string

MakeTextJsonFunction(string, IReadOnlyList<string>)

Renders a text-JSON function over the already-rendered args. The default implementation wraps MakeTextJsonFunction(string), which is enough when the provider's spelling is a plain function call; a provider whose form nests functions (MySQL renders json_value as json_unquote(json_extract(...))) overrides this. Only called when SupportsTextJson is true.

public virtual string MakeTextJsonFunction(string name, IReadOnlyList<string> args)

Parameters

name string
args IReadOnlyList<string>

Returns

string

MakeTop(int, bool, out string?, KeywordCase)

Renders a TOP(n)-style limit clause. Returns false when the dialect cannot express the limit inline and paging must be rendered by MakePage(Paging, StringBuilder, KeywordCase) instead.

public virtual bool MakeTop(int limit, bool withTies, out string? topStmt, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

limit int

The maximum number of rows to return.

withTies bool

Requests the WITH TIES variant where the dialect supports it.

topStmt string

The inline limit fragment, or null when the dialect returns false.

keywordCase KeywordCase

The letter case in which the emitted SQL keywords are written.

Returns

bool

true when topStmt carries the limit; otherwise false.

MakeTrim(string, StringTrimKind)

Renders a leading/trailing whitespace trim.

public virtual string MakeTrim(string value, StringTrimKind kind)

Parameters

value string
kind StringTrimKind

Returns

string

MakeTruncate(string, KeywordCase)

Renders TRUNCATE TABLE <table>; only reached through a dialect that set SupportsTruncate.

public virtual string MakeTruncate(string table, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

table string
keywordCase KeywordCase

Returns

string

MakeTryCast(string, Type)

The rejecting default of MakeTryCast(string, Type): only a dialect with a closed conversion map (SQL Server) may answer, so no provider silently renders a cast through MakeTypeName(Type)'s open name fall-back.

public virtual string MakeTryCast(string expression, Type targetType)

Parameters

expression string
targetType Type

Returns

string

Exceptions

NotSupportedException

Always: the provider has no TRY_CAST.

MakeTryConvert(string, Type, string?)

The rejecting default of MakeTryConvert(string, Type, string?); see MakeTryCast(string, Type) for why the conversion cannot reuse MakeTypeName(Type).

public virtual string MakeTryConvert(string expression, Type targetType, string? style)

Parameters

expression string
targetType Type
style string

Returns

string

Exceptions

NotSupportedException

Always: the provider has no TRY_CONVERT.

MakeTypeName(Type)

SQL type name used when a CLR conversion has to be rendered as a database cast.

public virtual string MakeTypeName(Type type)

Parameters

type Type

Returns

string

MakeUpdateHead(string, KeywordCase)

Renders the update head; defaults to the ANSI UPDATE <table> SET .

public virtual string MakeUpdateHead(string table, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

table string
keywordCase KeywordCase

Returns

string

MakeUpdateJoin(string, string, string, string, string, string, string?, KeywordCase)

Renders the FROM-style multi-table update (UPDATE <target> AS alias SET <assignments> FROM <usingSources> WHERE <joinConditions> [AND ...]), shared by PostgreSQL and SQLite. The target is aliased in UPDATE, the joined tables are listed in FROM and the join conditions are folded into the WHERE because a FROM join condition cannot reference the update target. Only reached through a dialect that set SupportsUpdateJoin; the alias-style dialects override it.

public virtual string MakeUpdateJoin(string target, string targetAlias, string assignments, string fromAndJoins, string usingSources, string joinConditions, string? whereSql, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

target string
targetAlias string
assignments string
fromAndJoins string
usingSources string
joinConditions string
whereSql string
keywordCase KeywordCase

Returns

string

MakeUpdateSuffix(KeywordCase)

Renders a suffix appended after the update's filter; defaults to none.

public virtual string? MakeUpdateSuffix(KeywordCase keywordCase = KeywordCase.Lower)

Parameters

keywordCase KeywordCase

Returns

string

MakeUpper(string)

Renders an upper case conversion.

public virtual string MakeUpper(string value)

Parameters

value string

Returns

string

MakeUpsertValueReference(string, KeywordCase)

Renders the incoming value of a column (excluded.<column>); MySQL/MariaDB override it with VALUES(<column>). The qualifier is not cased by KeywordCase.

public virtual string MakeUpsertValueReference(string column, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

column string
keywordCase KeywordCase

Returns

string

MakeWith(bool, KeywordCase)

Renders the opening keyword of a common table expression list (with). Dialects that support and require the recursive modifier for recursive CTEs (SQLite, PostgreSQL) emit with recursive; SQL Server declares a recursive CTE with with alone, so the flag is ignored there. Keeping this on the dialect avoids provider names in SqlBuilder.

public virtual string MakeWith(bool recursive, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

recursive bool
keywordCase KeywordCase

Returns

string

MakeWithinGroup(string, string, KeywordCase)

Renders an ordered-set aggregate as <aggregate> within group (order by <orderBy>). aggregate is the already-rendered call (for example percentile_cont(0.5)) and orderBy the already-rendered key list.

public virtual string MakeWithinGroup(string aggregate, string orderBy, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

aggregate string
orderBy string
keywordCase KeywordCase

Returns

string

PromoteDateOperand(string, string)

Promotes the already-rendered value operand of a sub-day date function so its time-of-day part is representable. A provider that applies date_add to a date-only operand can otherwise truncate or reject hour/minute/second/millisecond/ microsecond arithmetic (SQL Server dateadd on a date, ClickHouse add* on a Date). The default returns value unchanged, so providers with full timestamps or interval arithmetic are unaffected. field is a validated part name.

public virtual string PromoteDateOperand(string field, string value)

Parameters

field string
value string

Returns

string

QuoteIdentifier(string)

Quotes a physical identifier with the ANSI double-quote delimiter, doubling an embedded quote. A provider with a different delimiter overrides this; the alias-oriented Escape(string) is deliberately not reused because SQLite's single-quoted alias form is not a valid identifier.

public virtual string QuoteIdentifier(string name)

Parameters

name string

Returns

string

QuoteStringLiteral(string, bool)

Quotes value as a SQL string literal. escapeBackslash selects the dialects whose string syntax treats a backslash as an escape (MySQL/MariaDB, ClickHouse) and so has to double it; PostgreSQL (with standard_conforming_strings) and SQLite leave it as-is. Retained for external dialects and subclasses; the built-in providers resolve their spelling through the internal string-literal policy instead.

protected static string QuoteStringLiteral(string value, bool escapeBackslash = false)

Parameters

value string
escapeBackslash bool

Returns

string

RenderOrderBy(string, OrderDirection, NullsPosition)

Renders one logical ORDER BY item with an explicit NULL placement. The default emulates the placement with a CASE rank key whose prefix is always ascending; providers that opt into SupportsNullsOrdering override it with the native form.

public virtual string RenderOrderBy(string expressionSql, OrderDirection direction, NullsPosition nullsPosition)

Parameters

expressionSql string

The already-qualified, already-quoted key SQL.

direction OrderDirection

The requested key direction.

nullsPosition NullsPosition

The explicit NULL placement.

Returns

string

The rendered ordering item.

RenderQueryHints(string, IReadOnlyList<string>, string?, KeywordCase)

Applies the statement-level hints to an already-rendered sql statement. maxRecursionOption is the trailing option produced by MakeMaxRecursion(int, KeywordCase) (or null); a dialect that must coalesce it into a single trailing option clause (SQL Server) uses it so the caller does not append it separately.

Only called when SupportsQueryHints is true; the base implementation returns the SQL unchanged and is expected to be overridden by an opting-in dialect.

public virtual string RenderQueryHints(string sql, IReadOnlyList<string> hints, string? maxRecursionOption, KeywordCase keywordCase = KeywordCase.Lower)

Parameters

sql string
hints IReadOnlyList<string>
maxRecursionOption string
keywordCase KeywordCase

Returns

string

SupportsArrayFunction(string)

True when the provider renders the named array function of PostgresFunctions on the array surface enabled by SupportsArrays. The default preserves the family gate: every function an array-capable provider rendered before is still rendered. A provider that must answer per name — because the server function is missing or version-gated (PostgreSQL array_reverse/array_sort) — overrides it, and the translator refuses the call at preparation instead of emitting SQL the server does not have. Declared as a default interface method so existing external implementations keep compiling.

public virtual bool SupportsArrayFunction(string name)

Parameters

name string

The SQL name of the array function, without schema qualification.

Returns

bool

SupportsDateAddField(string)

True when the provider accepts field as a date_add part.

public virtual bool SupportsDateAddField(string field)

Parameters

field string

Returns

bool

SupportsDateDiffField(string)

True when the provider accepts field as a date_diff part.

public virtual bool SupportsDateDiffField(string field)

Parameters

field string

Returns

bool

SupportsDatePart(string)

True for the ANSI date parts the generic extract can render; a dialect whose native spelling differs for a part extends this set (quarter/week/dow/isodow/epoch) as needed.

public virtual bool SupportsDatePart(string part)

Parameters

part string

Returns

bool

SupportsDateTruncField(string)

True when the provider accepts field as a date_trunc part.

public virtual bool SupportsDateTruncField(string field)

Parameters

field string

Returns

bool

SupportsResultSchema(TableFunctionSchema)

Defaults to false; ClickHouse and PostgreSQL opt into a row-derived result schema for their native placement.

public virtual bool SupportsResultSchema(TableFunctionSchema placement)

Parameters

placement TableFunctionSchema

Returns

bool

SupportsTableFunction(string)

True when the provider supports the built-in table-valued function name declared in CommonFunctions (for example generate_series, unnest, string_split, openjson, numbers/numbers_mt, zeros/zeros_mt). User-defined table-function factories (returning TvfEntityBuilder<T>) are not gated by this and are emitted verbatim on every provider.

public virtual bool SupportsTableFunction(string name)

Parameters

name string

Returns

bool

SupportsTemporalKind(TemporalKind)

Defaults to false; a dialect that set SupportsTemporalTable names the kinds it accepts (MariaDB has no CONTAINED IN).

public virtual bool SupportsTemporalKind(TemporalKind kind)

Parameters

kind TemporalKind

Returns

bool

WrapCount(string, bool)

Wraps a fully rendered count(...) or countIf(...) expression, or returns it unchanged. Only called when WrapsCountResult is true; big is true for the 64-bit variants (count_big/count_big_distinct). ClickHouse casts the unsigned result to Int32/Int64 so the row reader can materialise it into the CLR integer the function declares.

public virtual string WrapCount(string countExpression, bool big)

Parameters

countExpression string
big bool

Returns

string

WrapIntegerWindowResult(string)

Wraps a fully rendered ranking window-function expression (row_number(), rank(), dense_rank(), ntile()) whose declared CLR result is a CLR integer, or returns it unchanged. Declared as a default interface method returning the expression unchanged so existing external implementations keep compiling; ClickHouse overrides it because its ranking window functions return UInt64, which the row reader cannot materialise into the declared int (the many-to-many JoinInto link occurrence is the first victim).

public virtual string WrapIntegerWindowResult(string windowExpression)

Parameters

windowExpression string

Returns

string

WrapTableFunction(string, string)

Wraps the rendered table-function call, or returns it unchanged. ClickHouse uses it to cast the unsigned numbers column to a type the row reader supports.

public virtual string WrapTableFunction(string name, string call)

Parameters

name string
call string

Returns

string

WrapTableFunction(string, string, IReadOnlyList<string>)

Wraps the rendered table-function call with its structured, already-rendered arguments, or returns it unchanged. The default forwards to WrapTableFunction(string, string); SQLite overrides it so the FTS5 table token is quoted as one identifier without reparsing the serialized call text.

public virtual string WrapTableFunction(string name, string call, IReadOnlyList<string> arguments)

Parameters

name string
call string
arguments IReadOnlyList<string>

Returns

string