Class SqlDialectBase
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
ArrayJoinClause
Defaults to null; ClickHouse opts into the ARRAY JOIN clause.
public virtual IArrayJoinRenderer? ArrayJoinClause { get; }
Property Value
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
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
ConcatStringOperator
String concatenation operator, e.g. + or ||.
public virtual string ConcatStringOperator { get; }
Property Value
CreateTableAsSelectUsesSelectInto
Defaults to false; SQL Server materialises through SELECT ... INTO instead of CREATE TABLE ... AS SELECT.
public virtual bool CreateTableAsSelectUsesSelectInto { get; }
Property Value
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
DeleteJoinRequiresUsing
Defaults to false; PostgreSQL overrides it because its multi-table delete uses USING.
public virtual bool DeleteJoinRequiresUsing { get; }
Property Value
DeleteRequiresWhere
Defaults to false; ClickHouse's ALTER TABLE ... DELETE requires a WHERE clause.
public virtual bool DeleteRequiresWhere { get; }
Property Value
DistinctOn
Defaults to null; PostgreSQL opts into DISTINCT ON.
public virtual IDistinctOnRenderer? DistinctOn { get; }
Property Value
EmptyString
SQL literal for an empty string.
public virtual string EmptyString { get; }
Property Value
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
ExtremeRowRenderer
Defaults to null; a dialect with a native SelectWhereMax/SelectWhereMin strategy opts in.
public virtual IExtremeRowRenderer? ExtremeRowRenderer { get; }
Property Value
Iif
Defaults to null; every SQL provider exposes its native iif renderer.
public virtual IIifRenderer? Iif { get; }
Property Value
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
LimitBy
Defaults to null; ClickHouse exposes the LIMIT n BY expr renderer.
public virtual ILimitByRenderer? LimitBy { get; }
Property Value
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
Lock
Defaults to null; PostgreSQL, MySQL, MariaDB and SQL Server opt into row locking.
public virtual ILockRenderer? Lock { get; }
Property Value
MultiIf
Defaults to null; only ClickHouse opts into the multiIf multi-branch conditional.
public virtual IMultiIfRenderer? MultiIf { get; }
Property Value
MySqlFunctions
Defaults to null; MySQL/MariaDB expose their native-function renderer.
public virtual IMySqlFunctions? MySqlFunctions { get; }
Property Value
NativeJsonProviderType
Defaults to JsonElement; ClickHouse uses JsonObject.
public virtual Type NativeJsonProviderType { get; }
Property Value
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
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
Pivot
Defaults to null; SQL Server opts into the native PIVOT/UNPIVOT pair.
public virtual IPivotRenderer? Pivot { get; }
Property Value
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
RequireSubqueryAlias
True for providers that require a derived table (subquery in FROM) to have an alias.
public virtual bool RequireSubqueryAlias { get; }
Property Value
RequiresIdentityInsertToggle
Defaults to false; SQL Server wraps explicit-identity inserts with SET IDENTITY_INSERT.
public virtual bool RequiresIdentityInsertToggle { get; }
Property Value
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
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
ScalarFunctions
Defaults to null; every SQL provider exposes its cross-provider scalar-function renderer.
public virtual IScalarFunctions? ScalarFunctions { get; }
Property Value
SequenceAggregates
Defaults to null; ClickHouse opts into the windowFunnel/retention/sequenceMatch aggregates.
public virtual ISequenceAggregateRenderer? SequenceAggregates { get; }
Property Value
SessionInfoFunctions
Defaults to null; a provider with a native spelling exposes its renderer.
public virtual ISessionInfoFunctions? SessionInfoFunctions { get; }
Property Value
SqlServerFunctions
Defaults to null; only SQL Server exposes the T-SQL-only scalar-function renderer.
public virtual ISqlServerFunctions? SqlServerFunctions { get; }
Property Value
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
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
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
SupportsAnyLastAggregate
Defaults to false; ClickHouse opts into the any/anyLast aggregates.
public virtual bool SupportsAnyLastAggregate { get; }
Property Value
SupportsAnyValueAggregate
Defaults to false; MySQL/MariaDB and ClickHouse opt into the arbitrary-value aggregate.
public virtual bool SupportsAnyValueAggregate { get; }
Property Value
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
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
SupportsApproxCountDistinctAggregate
Defaults to false; SQL Server from major version 15 opts into APPROX_COUNT_DISTINCT.
public virtual bool SupportsApproxCountDistinctAggregate { get; }
Property Value
SupportsApproxPercentileCont
Defaults to false; SQL Server from major version 16 opts into APPROX_PERCENTILE_CONT.
public virtual bool SupportsApproxPercentileCont { get; }
Property Value
SupportsApproxPercentileDisc
Defaults to false; SQL Server from major version 16 opts into APPROX_PERCENTILE_DISC.
public virtual bool SupportsApproxPercentileDisc { get; }
Property Value
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
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
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
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
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
SupportsBase64Decode
Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.
public virtual bool SupportsBase64Decode { get; }
Property Value
SupportsBase64Encode
Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.
public virtual bool SupportsBase64Encode { get; }
Property Value
SupportsBatch
Defaults to false; PostgreSQL, SQL Server, MySQL/MariaDB and SQLite opt into one-round-trip batches.
public virtual bool SupportsBatch { get; }
Property Value
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
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
SupportsBulkCopy
Defaults to false; PostgreSQL, SQL Server, MySQL/MariaDB and ClickHouse opt into a native bulk API.
public virtual bool SupportsBulkCopy { get; }
Property Value
SupportsChecksumAggregate
Defaults to false; SQL Server opts into CHECKSUM_AGG.
public virtual bool SupportsChecksumAggregate { get; }
Property Value
SupportsChoose
Defaults to false; only SQL Server opts into the choose conditional function.
public virtual bool SupportsChoose { get; }
Property Value
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
SupportsColumnDefault
Defaults to false; PostgreSQL, SQL Server, MySQL and MariaDB accept DEFAULT as a value.
public virtual bool SupportsColumnDefault { get; }
Property Value
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
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
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
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
SupportsCreateTableAsSelectOnCommit
Defaults to false; only PostgreSQL accepts ON COMMIT on a temporary table.
public virtual bool SupportsCreateTableAsSelectOnCommit { get; }
Property Value
SupportsCreateTableAsSelectWithNoData
Defaults to false; only PostgreSQL accepts WITH [NO] DATA.
public virtual bool SupportsCreateTableAsSelectWithNoData { get; }
Property Value
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
SupportsCryptGenRandom
Defaults to false; SQL Server, PostgreSQL, MySQL and MariaDB opt in.
public virtual bool SupportsCryptGenRandom { get; }
Property Value
SupportsCryptoFunctions
Only PostgreSQL has the digest/sha256 hash surface.
public virtual bool SupportsCryptoFunctions { get; }
Property Value
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
SupportsDataModifyingCtes
Defaults to false; only PostgreSQL accepts a data-modifying statement (INSERT ... RETURNING) as a CTE body.
public virtual bool SupportsDataModifyingCtes { get; }
Property Value
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
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
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
SupportsDefaultValues
Defaults to false; every SQL provider except ClickHouse opts into an all-defaults insert.
public virtual bool SupportsDefaultValues { get; }
Property Value
SupportsDelete
Defaults to true; ClickHouse renders its ALTER TABLE ... DELETE mutation through MakeDeleteHead(string, KeywordCase).
public virtual bool SupportsDelete { get; }
Property Value
SupportsDeleteJoin
Defaults to false; PostgreSQL, SQL Server, MySQL and MariaDB override it for native multi-table deletes.
public virtual bool SupportsDeleteJoin { get; }
Property Value
SupportsDeleteJoinReturning
Defaults to false; only PostgreSQL returns the affected rows of a multi-table DELETE ... USING ... JOIN.
public virtual bool SupportsDeleteJoinReturning { get; }
Property Value
SupportsDictionaries
Defaults to false; ClickHouse opts into the dictionary functions.
public virtual bool SupportsDictionaries { get; }
Property Value
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
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
SupportsFinal
Defaults to false; ClickHouse opts into the FINAL modifier.
public virtual bool SupportsFinal { get; }
Property Value
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
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
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
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
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
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
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
SupportsGroupByWithTotals
Defaults to false; ClickHouse opts into the GROUP BY ... WITH TOTALS modifier.
public virtual bool SupportsGroupByWithTotals { get; }
Property Value
SupportsGroupingIdAggregate
Defaults to false; SQL Server opts into GROUPING_ID.
public virtual bool SupportsGroupingIdAggregate { get; }
Property Value
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
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
SupportsIdentityFunction
Defaults to SupportsLastInsertId; SQL Server and PostgreSQL opt in explicitly.
public virtual bool SupportsIdentityFunction { get; }
Property Value
SupportsInFrameWindowFunctions
Defaults to false; ClickHouse opts into the frame-respecting lagInFrame/leadInFrame.
public virtual bool SupportsInFrameWindowFunctions { get; }
Property Value
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
SupportsInsertIgnore
Defaults to false; SQLite, MySQL, MariaDB and ClickHouse opt into an INSERT ... IGNORE head.
public virtual bool SupportsInsertIgnore { get; }
Property Value
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
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
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
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
SupportsJsonExtract
Defaults to false; ClickHouse opts into the string-JSON JSONExtract* family and the native-JSON functions.
public virtual bool SupportsJsonExtract { get; }
Property Value
SupportsLastInsertId
Defaults to false; MySQL/MariaDB opt into LAST_INSERT_ID().
public virtual bool SupportsLastInsertId { get; }
Property Value
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
SupportsMerge
Defaults to false; SQL Server opts into a key-upsert MERGE.
public virtual bool SupportsMerge { get; }
Property Value
SupportsMergeBySourceDelete
Defaults to false; only SQL Server opts into WHEN NOT MATCHED BY SOURCE.
public virtual bool SupportsMergeBySourceDelete { get; }
Property Value
SupportsMergeConditionalBranches
Defaults to false; SQL Server and PostgreSQL accept an explicit ON <condition> and WHEN ... AND <condition>.
public virtual bool SupportsMergeConditionalBranches { get; }
Property Value
SupportsMergeDelete
Defaults to false; SQL Server and PostgreSQL opt into a WHEN MATCHED THEN DELETE branch.
public virtual bool SupportsMergeDelete { get; }
Property Value
SupportsMergeDoNothing
Defaults to false; only PostgreSQL accepts THEN DO NOTHING (SQL Server has no such action).
public virtual bool SupportsMergeDoNothing { get; }
Property Value
SupportsMergeStatement
Defaults to false; SQL Server and PostgreSQL 15+ opt into the general, multi-branch MERGE.
public virtual bool SupportsMergeStatement { get; }
Property Value
SupportsMergeTargetQualification
Defaults to true; PostgreSQL overrides it because a MERGE target column must not be qualified.
public virtual bool SupportsMergeTargetQualification { get; }
Property Value
SupportsNamedWindows
Defaults to false; PostgreSQL, MySQL, MariaDB, ClickHouse and SQLite opt into named windows.
public virtual bool SupportsNamedWindows { get; }
Property Value
SupportsNativeDuration
Defaults to false; PostgreSQL, MySQL and MariaDB opt into a native duration type.
public virtual bool SupportsNativeDuration { get; }
Property Value
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
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
SupportsOnConflict
Defaults to false; PostgreSQL and SQLite 3.24+ opt into ON CONFLICT ... DO UPDATE.
public virtual bool SupportsOnConflict { get; }
Property Value
SupportsOnConflictDoNothing
Defaults to false; PostgreSQL and SQLite opt into a trailing ON CONFLICT DO NOTHING.
public virtual bool SupportsOnConflictDoNothing { get; }
Property Value
SupportsOnDuplicateKey
Defaults to false; MySQL and MariaDB opt into ON DUPLICATE KEY UPDATE.
public virtual bool SupportsOnDuplicateKey { get; }
Property Value
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
SupportsOrderedPercentiles
Defaults to false; PostgreSQL opts into the ordered-set percentile/median form.
public virtual bool SupportsOrderedPercentiles { get; }
Property Value
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
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
SupportsOutput
Defaults to false; SQL Server opts into the OUTPUT clause.
public virtual bool SupportsOutput { get; }
Property Value
SupportsOutputInto
Defaults to false; only SQL Server opts into OUTPUT ... INTO.
public virtual bool SupportsOutputInto { get; }
Property Value
SupportsPasteJoin
True when the dialect understands the ClickHouse PASTE JOIN kind; the safe default is false.
public virtual bool SupportsPasteJoin { get; }
Property Value
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
SupportsPercentileWindow
Defaults to false; SQL Server and MariaDB opt into the window percentile functions.
public virtual bool SupportsPercentileWindow { get; }
Property Value
SupportsPostgresJsonSql
Defaults to false; only PostgreSQL renders the JSON functions/operators surface.
public virtual bool SupportsPostgresJsonSql { get; }
Property Value
SupportsPreWhere
Defaults to false; ClickHouse opts into the PREWHERE clause.
public virtual bool SupportsPreWhere { get; }
Property Value
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
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
SupportsRandomSeed
Only PostgreSQL has a standalone session random seed (setseed).
public virtual bool SupportsRandomSeed { get; }
Property Value
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
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
SupportsRawSqlSource
Defaults to false; every SQL provider overrides it to true (derived tables).
public virtual bool SupportsRawSqlSource { get; }
Property Value
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
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
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
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
SupportsReturning
Defaults to false; PostgreSQL and SQLite opt into the RETURNING clause.
public virtual bool SupportsReturning { get; }
Property Value
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
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
SupportsSample
Defaults to false; ClickHouse opts into the SAMPLE modifier.
public virtual bool SupportsSample { get; }
Property Value
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
SupportsSelectWhereMinMax
Defaults to false; every built-in dialect opts into SelectWhereMax/SelectWhereMin.
public virtual bool SupportsSelectWhereMinMax { get; }
Property Value
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
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
SupportsSettings
Defaults to false; ClickHouse opts into the trailing SETTINGS clause.
public virtual bool SupportsSettings { get; }
Property Value
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
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
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
SupportsStoredProcedures
Defaults to false; SQL Server, PostgreSQL and MySQL/MariaDB opt into stored-procedure execution (CommandType.StoredProcedure).
public virtual bool SupportsStoredProcedures { get; }
Property Value
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
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
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
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
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
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
SupportsTemporalTable
Defaults to false; SQL Server and MariaDB opt into FOR SYSTEM_TIME.
public virtual bool SupportsTemporalTable { get; }
Property Value
SupportsTemporaryCreateTableAsSelect
Defaults to SupportsCreateTableAsSelect; only PostgreSQL, SQLite, MySQL and MariaDB keep a temporary form.
public virtual bool SupportsTemporaryCreateTableAsSelect { get; }
Property Value
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
SupportsTextSearchFunctions
Defaults to false; PostgreSQL opts into the native text-search scalar surface.
public virtual bool SupportsTextSearchFunctions { get; }
Property Value
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
SupportsTruncate
Defaults to false; SQLite has no TRUNCATE, so it keeps the default and callers use DELETE.
public virtual bool SupportsTruncate { get; }
Property Value
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
SupportsUpdate
Defaults to true; ClickHouse renders its ALTER TABLE ... UPDATE mutation through MakeUpdateHead(string, KeywordCase).
public virtual bool SupportsUpdate { get; }
Property Value
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
SupportsUpdateJoinReturning
Defaults to false; only PostgreSQL returns the affected rows of a multi-table UPDATE ... FROM ... JOIN.
public virtual bool SupportsUpdateJoinReturning { get; }
Property Value
SupportsUpdateReturning
Defaults to SupportsReturning; MariaDB gates UPDATE ... RETURNING on server version 13.0+.
public virtual bool SupportsUpdateReturning { get; }
Property Value
SupportsWindowFrameExclusion
Defaults to false; PostgreSQL and SQLite opt into the frame EXCLUDE clause.
public virtual bool SupportsWindowFrameExclusion { get; }
Property Value
SupportsWindowFrameGroups
Defaults to false; PostgreSQL, ClickHouse and SQLite opt into the GROUPS frame unit.
public virtual bool SupportsWindowFrameGroups { get; }
Property Value
SupportsWithTies
Defaults to false; PostgreSQL and SQL Server opt into WITH TIES paging.
public virtual bool SupportsWithTies { get; }
Property Value
TableSample
Defaults to null; PostgreSQL and SQL Server opt into TABLESAMPLE.
public virtual ITableSampleMethods? TableSample { get; }
Property Value
TopKAggregates
Defaults to null; ClickHouse opts into the topK/topKWeighted aggregates.
public virtual ITopKAggregateRenderer? TopKAggregates { get; }
Property Value
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
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
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
UpdateRequiresWhere
Defaults to false; ClickHouse's ALTER TABLE ... UPDATE requires a WHERE clause.
public virtual bool UpdateRequiresWhere { get; }
Property Value
UuidGenerators
Defaults to null; a provider with native UUID generators exposes its renderer.
public virtual IUuidGenerators? UuidGenerators { get; }
Property Value
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
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
XmlFunctions
Defaults to null; only SQL Server opts into the postfix XML data-type methods.
public virtual IXmlFunctions? XmlFunctions { get; }
Property Value
Methods
Escape(string)
Quotes an identifier (alias, keyword).
public virtual string Escape(string keyword)
Parameters
keywordstring
Returns
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
queryCommandQueryCommand
Returns
IsSubDayField(string)
True for the date parts below a day, which need a fractional timestamp operand.
protected static bool IsSubDayField(string field)
Parameters
fieldstring
Returns
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
Returns
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
keywordCaseKeywordCasetextstring
Returns
MakeAggregate(string)
Maps an aggregate function name to the provider specific one, e.g. stdev -> stddev.
public virtual string MakeAggregate(string name)
Parameters
namestring
Returns
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
applyTypeJoinTypesourcestringkeywordCaseKeywordCase
Returns
MakeArrayAgg(string)
Renders the array_agg(value) aggregate over the already-rendered argument.
public virtual string MakeArrayAgg(string value)
Parameters
valuestring
Returns
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
Returns
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
Returns
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
argumentstringThe rendered argument expression.
inputTypeTypeThe 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
aggregatestringThe fully rendered aggregate, including its filter or window clause.
argumentstringThe rendered value argument, as it appears inside the aggregate.
filterPredicatestringThe rendered aggregate filter predicate, or null.
windowClausestringThe 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
valuestring
Returns
MakeBase64Encode(string)
Defaults to the unsupported-provider exception; reached only when SupportsBase64Encode is true.
public virtual string MakeBase64Encode(string value)
Parameters
valuestring
Returns
MakeBool(bool)
Renders the SQL literal for a boolean value.
public virtual string MakeBool(bool v)
Parameters
vbool
Returns
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
Returns
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
Returns
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
valuestring
Returns
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
caseExpressionstringisBooleanResultboolasPredicateboolkeywordCaseKeywordCase
Returns
MakeCoalesce(string, string)
Renders coalesce(v1, v2) over the already-rendered operands.
public virtual string MakeCoalesce(string v1, string v2)
Parameters
Returns
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
valuestringcollationstringkeywordCaseKeywordCase
Returns
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
colAliasstringkeywordCaseKeywordCase
Returns
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
keywordCaseKeywordCase
Returns
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
namestring
Returns
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
partsIReadOnlyList<string>
Returns
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
Returns
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
clauseCreateTableAsClauseThe resolved clause options.
keywordCaseKeywordCaseThe 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
clauseCreateTableAsClauseselectSqlstringkeywordCaseKeywordCase
Returns
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
clauseCreateTableAsClausekeywordCaseKeywordCase
Returns
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
clauseCreateTableAsClauseThe resolved clause options.
keywordCaseKeywordCaseThe 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
lengthstring
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
MakeDatePart(string, string)
Renders a date/time part extraction (year, month, day, hour, ...).
public virtual string MakeDatePart(string part, string value)
Parameters
Returns
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
Returns
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
utcbool
Returns
MakeDateTrunc(string, string)
Renders date_trunc(field, value); field is a validated date-part name.
public virtual string MakeDateTrunc(string field, string value)
Parameters
Returns
MakeDefaultValues(KeywordCase)
Renders the all-defaults row form; MySQL/MariaDB override it with () VALUES ().
public virtual string MakeDefaultValues(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
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
tablestringkeywordCaseKeywordCase
Returns
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
targetstringtargetAliasstringfromAndJoinsstringusingSourcesstringjoinConditionsstringwhereSqlstringkeywordCaseKeywordCase
Returns
MakeDeleteSuffix(KeywordCase)
Renders a suffix appended after the delete's filter; defaults to none.
public virtual string? MakeDeleteSuffix(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
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
columnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
columnsIReadOnlyList<string>targetstringtargetColumnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
namestringargsIReadOnlyList<string>
Returns
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
unitDurationUnit?precisionint
Returns
MakeEndOfMonth(string)
Renders the last day of the month of the already-rendered value.
public virtual string MakeEndOfMonth(string value)
Parameters
valuestring
Returns
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
Returns
MakeFinal(KeywordCase)
Renders the FINAL modifier; ClickHouse places it right after the table.
public virtual string MakeFinal(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
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
clauseForJsonClausekeywordCaseKeywordCase
Returns
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
clauseForXmlClausekeywordCaseKeywordCase
Returns
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
Returns
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
Returns
MakeGreatest(IReadOnlyList<string>)
Renders greatest(...) over the already-rendered arguments.
public virtual string MakeGreatest(IReadOnlyList<string> args)
Parameters
argsIReadOnlyList<string>
Returns
MakeGroupByTotals(string, KeywordCase)
Returns the grouping clause unchanged; ClickHouse appends with totals.
public virtual string MakeGroupByTotals(string grouping, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
groupingstringkeywordCaseKeywordCase
Returns
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
columnsstringgroupingTypeGroupingTypekeywordCaseKeywordCase
Returns
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
groupingSetsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
keywordCaseKeywordCase
Returns
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
tablestringkeywordCaseKeywordCase
Returns
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
tablestringkeywordCaseKeywordCase
Returns
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
keywordCaseKeywordCase
Returns
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
Returns
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
joinTypeJoinTypestrictnessJoinStrictnessisGlobalboolkeywordCaseKeywordCase
Returns
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
joinTypeJoinTypestrictnessJoinStrictnessisGlobalboolhintstringkeywordCaseKeywordCase
Returns
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
namestringargsIReadOnlyList<string>
Returns
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
keywordCaseKeywordCase
Returns
MakeLeast(IReadOnlyList<string>)
Renders least(...) over the already-rendered arguments.
public virtual string MakeLeast(IReadOnlyList<string> args)
Parameters
argsIReadOnlyList<string>
Returns
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
escapeCharstringkeywordCaseKeywordCase
Returns
MakeLower(string)
Renders a lower case conversion.
public virtual string MakeLower(string value)
Parameters
valuestring
Returns
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
namestringargsIReadOnlyList<string>
Returns
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
namestringargsIReadOnlyList<string>argTypesIReadOnlyList<Type>
Returns
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
maxRecursionintkeywordCaseKeywordCase
Returns
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
targetstringcolumnsIReadOnlyList<string>keysIReadOnlyList<string>updateColumnsIReadOnlyList<string>valuesRowsstringkeywordCaseKeywordCasereturningColumnsIReadOnlyList<string>
Returns
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
columnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeMergeStatementTerminator(KeywordCase)
Renders the terminator of a general MERGE; defaults to none, SQL Server requires ;.
public virtual string MakeMergeStatementTerminator(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeNow(bool)
Renders the current local or UTC date/time.
public virtual string MakeNow(bool utc)
Parameters
utcbool
Returns
MakeNullIf(string, string)
Renders nullif(value, other). ANSI and portable, so every dialect accepts it.
public virtual string MakeNullIf(string value, string other)
Parameters
Returns
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
unitDurationUnit?The declared storage unit, or
null.precisionintThe 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
keysIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
keywordCaseKeywordCase
Returns
MakeOnDuplicateKey(KeywordCase)
Renders ON DUPLICATE KEY UPDATE ; only reached through a dialect that set SupportsOnDuplicateKey.
public virtual string MakeOnDuplicateKey(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
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
operandstring
Returns
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
Returns
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
columnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
columnsIReadOnlyList<string>targetstringtargetColumnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
keywordCaseKeywordCase
Returns
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
Returns
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
pagingPagingsqlBuilderStringBuilderkeywordCaseKeywordCase
MakeParam(string)
Renders a parameter placeholder, e.g. @name or $name.
public abstract string MakeParam(string name)
Parameters
namestring
Returns
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
serverstringThe linked-server name, or
null.databasestringThe database name, or
null.schemastringThe schema name, or
null.tablestringThe 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
Returns
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
Returns
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
Returns
MakeReplace(string, string, string)
Renders a string replace.
public virtual string MakeReplace(string value, string oldValue, string newValue)
Parameters
Returns
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
Returns
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
columnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeSample(double, double, KeywordCase)
Renders the SAMPLE ratio [OFFSET offset] modifier.
public virtual string MakeSample(double ratio, double offset, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
ratiodoubleoffsetdoublekeywordCaseKeywordCase
Returns
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
settingsIReadOnlyList<KeyValuePair<string, string>>keywordCaseKeywordCase
Returns
MakeStringAgg(string, string)
Renders the string_agg(value, delimiter) aggregate over the already-rendered arguments.
public virtual string MakeStringAgg(string value, string delimiter)
Parameters
Returns
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
Returns
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
Returns
MakeStringLength(string)
Renders a string length function over value (SQL Server len, others length).
public virtual string MakeStringLength(string value)
Parameters
valuestring
Returns
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
Returns
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
Returns
MakeStringReverse(string)
Renders a character-wise reversal of value.
protected virtual string MakeStringReverse(string value)
Parameters
valuestring
Returns
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
Returns
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
Returns
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
Returns
MakeTableAlias(string, KeywordCase)
Renders the alias clause for a table source (AS alias).
public virtual string MakeTableAlias(string tableAlias, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tableAliasstringkeywordCaseKeywordCase
Returns
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
tableAliasstringcolumnDefinitionListstringkeywordCaseKeywordCase
Returns
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
hintsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
hintsIReadOnlyList<string>keywordCaseKeywordCase
Returns
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
clauseTemporalClausekeywordCaseKeywordCase
Returns
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
namestring
Returns
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
namestringargsIReadOnlyList<string>
Returns
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
limitintThe maximum number of rows to return.
withTiesboolRequests the
WITH TIESvariant where the dialect supports it.topStmtstringThe inline limit fragment, or
nullwhen the dialect returns false.keywordCaseKeywordCaseThe letter case in which the emitted SQL keywords are written.
Returns
- bool
truewhentopStmtcarries the limit; otherwisefalse.
MakeTrim(string, StringTrimKind)
Renders a leading/trailing whitespace trim.
public virtual string MakeTrim(string value, StringTrimKind kind)
Parameters
valuestringkindStringTrimKind
Returns
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
tablestringkeywordCaseKeywordCase
Returns
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
Returns
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
Returns
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
typeType
Returns
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
tablestringkeywordCaseKeywordCase
Returns
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
targetstringtargetAliasstringassignmentsstringfromAndJoinsstringusingSourcesstringjoinConditionsstringwhereSqlstringkeywordCaseKeywordCase
Returns
MakeUpdateSuffix(KeywordCase)
Renders a suffix appended after the update's filter; defaults to none.
public virtual string? MakeUpdateSuffix(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeUpper(string)
Renders an upper case conversion.
public virtual string MakeUpper(string value)
Parameters
valuestring
Returns
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
columnstringkeywordCaseKeywordCase
Returns
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
recursiveboolkeywordCaseKeywordCase
Returns
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
aggregatestringorderBystringkeywordCaseKeywordCase
Returns
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
Returns
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
namestring
Returns
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
Returns
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
expressionSqlstringThe already-qualified, already-quoted key SQL.
directionOrderDirectionThe requested key direction.
nullsPositionNullsPositionThe 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
sqlstringhintsIReadOnlyList<string>maxRecursionOptionstringkeywordCaseKeywordCase
Returns
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
namestringThe SQL name of the array function, without schema qualification.
Returns
SupportsDateAddField(string)
True when the provider accepts field as a date_add part.
public virtual bool SupportsDateAddField(string field)
Parameters
fieldstring
Returns
SupportsDateDiffField(string)
True when the provider accepts field as a date_diff part.
public virtual bool SupportsDateDiffField(string field)
Parameters
fieldstring
Returns
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
partstring
Returns
SupportsDateTruncField(string)
True when the provider accepts field as a date_trunc part.
public virtual bool SupportsDateTruncField(string field)
Parameters
fieldstring
Returns
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
placementTableFunctionSchema
Returns
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
namestring
Returns
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
kindTemporalKind
Returns
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
Returns
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
windowExpressionstring
Returns
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
Returns
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
namestringcallstringargumentsIReadOnlyList<string>