Interface ISqlDialect
Rendering contract of a SQL dialect: everything that differs between providers when SQL text is
produced. Kept separate from DataContext so that SQL generation does not depend on the
whole execution pipeline (connection lifecycle, plan cache, materialization) — see
SqlBuilder and the expression visitors, which depend on this interface only.
Connection/parameter creation (CreateConnection/CreateParam) and column mapping
(MapColumnExpression) are deliberately not part of this contract: they are separate axes.
public interface ISqlDialect
- 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.
AggregateFilterStyle AggregateFilterStyle { get; }
Property Value
ArrayJoinClause
The provider's renderer for the ARRAY JOIN clause; null means the provider cannot
express it. Declared as a default interface method so that existing external implementations keep
compiling.
IArrayJoinRenderer? ArrayJoinClause { get; }
Property Value
BatchUsesJoinedCommand
True when a batch must be sent as one ;-joined command even though the connection exposes
a DbBatch. SQL Server is the case: SqlBatch runs every
command in its own scope, so a session-local #temp table created by one command is not
visible to the next, while the statements of one SqlCommand share a batch scope. Only
meaningful when SupportsBatch is true. Declared as a default interface
method returning false.
bool BatchUsesJoinedCommand { get; }
Property Value
ClickHouseAggregates
The provider's renderer for the ClickHouse aggregate catalogue that has no cross-provider
spelling (the statistical aggregates, the parameterised quantile algorithms, the array- and
tuple-returning aggregates, the sequence aggregates and the time-series grid aggregates);
null means the provider cannot express them. Declared as a default interface method so
that existing external implementations keep compiling.
IClickHouseAggregateRenderer? ClickHouseAggregates { get; }
Property Value
ConcatStringOperator
String concatenation operator, e.g. + or ||.
string ConcatStringOperator { get; }
Property Value
CreateTableAsSelectUsesSelectInto
Whether the dialect renders the materialisation as SELECT ... INTO (SQL Server) rather than
CREATE TABLE ... AS SELECT. Declared as a default interface method returning false.
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.
IDateConversionRenderer? DateConversion { get; }
Property Value
DeleteJoinRequiresUsing
Whether MakeDeleteJoin(string, string, string, string, string, string?, KeywordCase) must be given the USING spelling (PostgreSQL) rather
than the alias spelling. Defaults to false.
bool DeleteJoinRequiresUsing { get; }
Property Value
DeleteRequiresWhere
Whether the dialect requires a WHERE clause on every delete (ClickHouse's
ALTER TABLE ... DELETE does). A delete without a predicate then renders a trivially true
filter (WHERE 1). Defaults to false.
bool DeleteRequiresWhere { get; }
Property Value
DistinctOn
The provider's renderer for the DISTINCT ON modifier; null means the provider cannot
express it. Declared as a default interface method so that existing external implementations keep
compiling.
IDistinctOnRenderer? DistinctOn { get; }
Property Value
EmptyString
SQL literal for an empty string.
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.
bool EnforcesScalarSubqueryCardinality { get; }
Property Value
ExtremeRowRenderer
The provider's optional native renderer for SelectWhereMax/SelectWhereMin;
null means the provider has no native strategy and the portable window-function lowering
is used. Declared as a default interface method returning null so existing external
implementations keep compiling; the generic builder never branches on the provider name.
IExtremeRowRenderer? ExtremeRowRenderer { get; }
Property Value
Iif
The provider's renderer for the conditional iif(condition, whenTrue, whenFalse). null
means the provider cannot express it. Declared as a default interface method so that existing
external implementations keep compiling.
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.
IIndexHintRenderer? IndexHints { get; }
Property Value
LimitBy
The provider's renderer for LIMIT [offset, ]n BY expr (ClickHouse). null means the
modifier is unavailable and a command that carries one is rejected when its SQL is built.
Declared as a default interface method so that existing external implementations keep compiling.
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.
string? LobLocatorColumn { get; }
Property Value
Lock
The provider's renderer for row locking; null means the provider cannot express it.
Declared as a default interface method so that existing external implementations keep compiling.
ILockRenderer? Lock { get; }
Property Value
MultiIf
The provider's renderer for the ClickHouse multi-branch conditional; null means the
provider cannot express it. Declared as a default interface method so that existing external
implementations keep compiling.
IMultiIfRenderer? MultiIf { get; }
Property Value
MySqlFunctions
The provider's renderer for the MySQL/MariaDB-only functions of MySqlFunctions
(find_in_set/field/elt, substring_index, format,
str_to_date/date_format, from_unixtime/unix_timestamp, md5/
sha1/sha2, inet_aton/inet_ntoa, the JSON mutation family and
uuid_to_bin/bin_to_uuid). null means the provider cannot express the family;
the object itself answers per name because MySQL and MariaDB can express different subsets.
Declared as a default interface method so that existing external implementations keep compiling.
IMySqlFunctions? MySqlFunctions { get; }
Property Value
NativeJsonProviderType
The CLR type the provider's native JSON representation materializes as (and binds a parameter to),
consulted only when native JSON storage is selected by SupportsJson. The safe default is
JsonElement; ClickHouse overrides it with JsonObject. Declared as a default
interface method so existing external implementations keep compiling.
Type NativeJsonProviderType { get; }
Property Value
NullSafeComparison
The renderer for the explicit null-safe comparison helpers (is_distinct_from<T>(T, T) and is_not_distinct_from<T>(T, T)), or null when the provider does not support them. The safe default is null: the helper is then rejected with an exception naming the provider and the form instead of emitting SQL the provider cannot execute. Declared as a default interface member so existing external implementations keep compiling without a new abstract obligation.
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, or null when the
dialect produces SQL nulls natively. Declared as a default interface method so external
implementations keep compiling; ClickHouse returns join_use_nulls=1.
IReadOnlyList<KeyValuePair<string, string>>? OuterJoinNullSettings { get; }
Property Value
Pivot
The provider's renderer for the native PIVOT/UNPIVOT pair; null means the
provider cannot express it. Declared as a default interface method so that existing external
implementations keep compiling.
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.
IQuantileAggregateRenderer? QuantileAggregates { get; }
Property Value
RequireSubqueryAlias
True for providers that require a derived table (subquery in FROM) to have an alias.
bool RequireSubqueryAlias { get; }
Property Value
RequiresIdentityInsertToggle
Whether writing explicit identity values requires wrapping the insert with a session toggle
(SQL Server SET IDENTITY_INSERT <table> ON/OFF). Declared as a default interface
method returning false so existing external implementations keep compiling; a dialect that
opts in also overrides MakeIdentityInsertOn(string, KeywordCase) and MakeIdentityInsertOff(string, KeywordCase).
bool RequiresIdentityInsertToggle { get; }
Property Value
RequiresQualifiedSelectStar
True when the provider rejects a bare mixed with explicit select expressions and requires
the star to be qualified with the source alias (MySQL and MariaDB: select id, * from t is a
syntax error while select id, t. from t as t is accepted). Consulted only for the
dynamic-columns store projection, where an unqualified is appended after the mapped
columns; the plain whole-row path is never qualified. Declared as a default interface
method returning false so existing external implementations keep compiling.
bool RequiresQualifiedSelectStar { get; }
Property Value
RequiresRecursiveCteUnionAll
Whether a recursive common table expression must be declared with UNION ALL rather than a
distinct UNION. Declared as a default interface method returning false so existing
implementations keep compiling. When true, a legacy WithRecursive declaration whose
body is a distinct UNION is unsupported and is rejected while the query is prepared, before
it reaches the server or the plan cache (SQL Server).
bool RequiresRecursiveCteUnionAll { get; }
Property Value
ScalarFunctions
The provider's renderer for the cross-provider scalar functions of CommonFunctions
(left/right, lpad/rpad, repeat/reverse/space,
concat_ws, translate, ascii/char, mod, log10,
power). null means the provider cannot express the family; the object itself
answers per name because the providers can express different subsets. Declared as a default
interface method so that existing external implementations keep compiling.
IScalarFunctions? ScalarFunctions { get; }
Property Value
SequenceAggregates
The provider's renderer for the ClickHouse sequence/funnel aggregates; null means the
provider cannot express them. Declared as a default interface method so that existing external
implementations keep compiling.
ISequenceAggregateRenderer? SequenceAggregates { get; }
Property Value
SessionInfoFunctions
The provider's session/information function surface (current_user, session_user,
current_schema, current_database, version). null means the provider
cannot express the family; the object itself answers per name because ClickHouse and SQLite can
express only part of it. Declared as a default interface method so that existing external
implementations keep compiling.
ISessionInfoFunctions? SessionInfoFunctions { get; }
Property Value
SqlServerFunctions
The provider's renderer for the SQL Server-only T-SQL scalar functions of
SqlServerFunctions (patindex, quotename, the trigonometric functions,
datename/date_bucket, hashbytes, the SQL/JSON constructors and aggregates, …).
null means the provider cannot express the family; the object itself answers per name.
Declared as a default interface method so that existing external implementations keep compiling.
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.
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.
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.
IStringSplitRenderer? StringSplit { get; }
Property Value
SupportsAnyLastAggregate
True when the provider can render the anyLast row-picking aggregate (the value of an
arbitrary last row; ClickHouseFunctions.any_last). The safe default is false;
ClickHouse opts in today. The arbitrary-value aggregate without the last-row restriction is
SupportsAnyValueAggregate.
bool SupportsAnyLastAggregate { get; }
Property Value
SupportsAnyValueAggregate
True when the provider can render the arbitrary-value aggregate
(CommonFunctions.any_agg): ANY_VALUE(x) on MySQL/MariaDB, any(x)
on ClickHouse. The safe default is false.
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.
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.
bool SupportsApplyOnPlainTable { get; }
Property Value
SupportsApproxCountDistinctAggregate
True when the provider can render the APPROX_COUNT_DISTINCT(value) aggregate
(approx_count_distinct<T>(T?)). On SQL Server it is available
from major version 15; the safe default is false, and an unversioned dialect
refuses the name. Declared as a default interface method so existing external implementations
keep compiling.
bool SupportsApproxCountDistinctAggregate { get; }
Property Value
SupportsApproxPercentileCont
True when the provider can render the ordered-set aggregate
APPROX_PERCENTILE_CONT(fraction) WITHIN GROUP (ORDER BY value)
(approx_percentile_cont<T>(double, T?)). On SQL Server it is
available from major version 16; the safe default is false, and an unversioned
dialect refuses the name. This is a name-specific gate: it deliberately does not widen
SupportsOrderedAggregates or SupportsOrderedPercentiles. Declared as
a default interface method so existing external implementations keep compiling.
bool SupportsApproxPercentileCont { get; }
Property Value
SupportsApproxPercentileDisc
True when the provider can render the ordered-set aggregate
APPROX_PERCENTILE_DISC(fraction) WITHIN GROUP (ORDER BY value)
(approx_percentile_disc<T>(double, T?)). On SQL Server it is
available from major version 16; the safe default is false, and an unversioned
dialect refuses the name. Name-specific, like SupportsApproxPercentileCont. Declared
as a default interface method so existing external implementations keep compiling.
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.
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.
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.
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[]).
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.
bool SupportsArrays { get; }
Property Value
SupportsBase64Decode
True when the provider can render base64_decode(string?) in its standard RFC 4648 form. The safe default is false; SQL Server, PostgreSQL, MySQL and MariaDB opt in. Declared as a default interface method so existing external implementations keep compiling.
bool SupportsBase64Decode { get; }
Property Value
SupportsBase64Encode
True when the provider can render base64_encode(byte[]?) in its standard RFC 4648 form. The safe default is false; SQL Server, PostgreSQL, MySQL and MariaDB opt in. Declared as a default interface method so existing external implementations keep compiling.
bool SupportsBase64Encode { get; }
Property Value
SupportsBatch
Whether the provider can execute several statements as one batch (see
BatchExtensions.Batch): each provider that opts in runs the whole set in a single
protocol exchange on the current connection, so the statements share one server session/backend
— the guarantee a session-scoped temporary table needs under a transaction-mode connection
pooler. PostgreSQL, SQL Server and MySQL/MariaDB use the driver's DbBatch;
SQLite joins the statements with ; into one command. Declared as a default interface
method returning false so existing external implementations keep compiling; ClickHouse
(no multi-statement guarantee) leaves it off.
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.
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.
bool SupportsBooleanAggregates { get; }
Property Value
SupportsBulkCopy
Whether the provider has a native bulk-copy API (PostgreSQL COPY BINARY, SQL Server
SqlBulkCopy, MySQL/MariaDB MySqlBulkCopy, ClickHouse binary insert). Declared as a
default interface method returning false so existing external implementations keep
compiling; a dialect that opts in is paired with a context overriding the native bulk hook.
bool SupportsBulkCopy { get; }
Property Value
SupportsChecksumAggregate
True when the provider can render the CHECKSUM_AGG(value) aggregate
(checksum_agg(int?)). SQL Server has it without a version
floor, so the flag is a plain provider opt-in; the safe default is false.
Declared as a default interface method so existing external implementations keep compiling.
bool SupportsChecksumAggregate { get; }
Property Value
SupportsChoose
True when the provider can render the SQL Server-only choose(index, value, ...)
(SqlServerFunctions.choose). The safe default is false; only SQL Server opts in.
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.
bool SupportsCollation { get; }
Property Value
SupportsColumnDefault
Whether the dialect can write the DEFAULT keyword as a value in the VALUES list
(PostgreSQL, SQL Server, MySQL, MariaDB), selecting the column default per row. Declared as a
default interface method returning false so existing external implementations keep
compiling.
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.
bool SupportsCommandBehaviorSingleRow { get; }
Property Value
SupportsCreateTableAsSelect
Whether the dialect can materialise a query into a persistent table. Declared as a default
interface method returning false so existing external implementations keep compiling;
PostgreSQL, SQLite, MySQL, MariaDB, ClickHouse and SQL Server opt in. SQL Server uses the
SELECT ... INTO form (see CreateTableAsSelectUsesSelectInto), the others
CREATE TABLE ... AS SELECT.
bool SupportsCreateTableAsSelect { get; }
Property Value
SupportsCreateTableAsSelectColumnList
Whether the dialect accepts a column list on CREATE TABLE ... AS SELECT (PostgreSQL,
MySQL, MariaDB). SQLite derives every column from the query and accepts no list; SQL Server takes
the names from the select list; ClickHouse needs name type pairs. All three keep the
default. Declared as a default interface method returning false.
bool SupportsCreateTableAsSelectColumnList { get; }
Property Value
SupportsCreateTableAsSelectIfNotExists
Whether the dialect accepts IF NOT EXISTS on the materialisation. Declared as a default
interface method returning false; PostgreSQL, SQLite, MySQL, MariaDB and ClickHouse opt in,
while SQL Server's SELECT ... INTO cannot express it, so the option is rejected there.
bool SupportsCreateTableAsSelectIfNotExists { get; }
Property Value
SupportsCreateTableAsSelectOnCommit
Whether the dialect accepts ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } on a
temporary table (PostgreSQL only). Declared as a default interface method returning false.
bool SupportsCreateTableAsSelectOnCommit { get; }
Property Value
SupportsCreateTableAsSelectWithNoData
Whether the dialect accepts WITH [NO] DATA after the query of a
CREATE TABLE ... AS SELECT (PostgreSQL only). Declared as a default interface method
returning false.
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.
bool SupportsCrossDatabase { get; }
Property Value
SupportsCryptGenRandom
True when the provider can render crypt_gen_random(int?). The safe default is false; SQL Server, PostgreSQL, MySQL and MariaDB opt in. Declared as a default interface method so existing external implementations keep compiling.
bool SupportsCryptGenRandom { get; }
Property Value
SupportsCryptoFunctions
True when the provider can render the cryptographic hash functions
(digest(string?, string?) and
sha256(byte[]?)). The safe default is false; only
PostgreSQL opts in. digest additionally requires the pgcrypto extension to be
installed on the server; sha256 is a core binary-string function.
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.
bool SupportsCube { get; }
Property Value
SupportsDataModifyingCtes
Whether the dialect can place a data-modifying statement as the body of a common table
expression (WITH <name> AS (INSERT ... RETURNING ...) ..., PostgreSQL only). Declared as
a default interface method returning false so existing external implementations keep
compiling: every other provider requires a CTE body to be a SELECT.
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.
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.
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.
bool SupportsDateTrunc { get; }
Property Value
SupportsDefaultValues
Whether the dialect can insert a row that writes only column defaults
(INSERT ... DEFAULT VALUES, or INSERT ... () VALUES () where the dialect overrides
MakeDefaultValues(KeywordCase)). Declared as a default interface method returning false so
existing external implementations keep compiling.
bool SupportsDefaultValues { get; }
Property Value
SupportsDelete
Whether the dialect can execute a DELETE and report the affected-row count. Declared as a
default interface method returning true; the native statement is rendered by
MakeDeleteHead(string, KeywordCase) (ClickHouse renders its ALTER TABLE ... DELETE mutation).
bool SupportsDelete { get; }
Property Value
SupportsDeleteJoin
Whether the dialect can delete rows of one table based on a join (a native multi-table
DELETE). Declared as a default interface method returning false; PostgreSQL, SQL
Server, MySQL and MariaDB override it. SQLite has no join-DELETE, and ClickHouse's
ALTER TABLE ... DELETE mutation cannot reference other tables, so both keep the default.
bool SupportsDeleteJoin { get; }
Property Value
SupportsDeleteJoinReturning
Whether the dialect can return the affected rows of a multi-table DELETE ... USING ... JOIN
through a RETURNING clause (PostgreSQL). Declared as a default interface method returning
false so existing external implementations keep compiling.
bool SupportsDeleteJoinReturning { get; }
Property Value
SupportsDictionaries
True when the provider can render the ClickHouse dictionary functions
(dictGet/dictGetOrDefault/dictGetOrNull/dictGetAll/
dictGetDescendants/dictHas/dictGetHierarchy/dictGetChildren/dictIsIn)
and the embedded-geobase region functions (regionToName/regionToCity/regionToArea/
regionToDistrict/regionToCountry/regionToContinent/regionToTopContinent/
regionToPopulation/regionHierarchy/regionIn).
The safe default is false; ClickHouse opts in today.
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.
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.
bool SupportsExtendedScalarFunctions { get; }
Property Value
SupportsFinal
Whether the dialect supports the FINAL table modifier (ClickHouse). When false, a
command that carries it is rejected when its SQL is built.
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.
bool SupportsForJson { get; }
Property Value
SupportsForXml
True when the provider can render a trailing FOR XML clause (SQL Server). The safe
default is false.
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.
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.
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.
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.
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.
bool SupportsGreatestLeast { get; }
Property Value
SupportsGroupByWithTotals
True when the provider can render the GROUP BY ... WITH TOTALS modifier (ClickHouse): a
grouped query that additionally returns one row with the totals over all groups. The safe default
is false; ClickHouse opts in today.
bool SupportsGroupByWithTotals { get; }
Property Value
SupportsGroupingIdAggregate
True when the provider can render the GROUPING_ID(expressions) aggregate
(grouping_id(params object?[])). SQL Server has it without a version
floor, so the flag is a plain provider opt-in; the safe default is false.
Declared as a default interface method so existing external implementations keep compiling.
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.
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.
bool SupportsHigherOrderArrayFunctions { get; }
Property Value
SupportsIdentityFunction
Whether the dialect can return the last generated identity of the current session through a
separate scalar query (SCOPE_IDENTITY(), lastval(), LAST_INSERT_ID(),
last_insert_rowid()) without naming the identity column. Declared as a default interface
method delegating to SupportsLastInsertId, so a dialect that already exposes the
scalar identity form needs no extra override; SQL Server and PostgreSQL opt in explicitly.
bool SupportsIdentityFunction { get; }
Property Value
SupportsInFrameWindowFunctions
True when the provider can render the frame-respecting offset window functions
lagInFrame(value[, offset[, default]])/leadInFrame(value[, offset[, default]])
(ClickHouseFunctions.lag_in_frame and ClickHouseFunctions.lead_in_frame). The safe
default is false; only ClickHouse opts in. The standard lag/lead look at the
whole partition and ignore the window frame; these variants are evaluated within the ordered
frame, so they differ on a partial frame.
bool SupportsInFrameWindowFunctions { get; }
Property Value
SupportsInlineHints
True when the provider expresses join/subquery/tables-in-scope hints as a statement-level inline
optimizer comment (PostgreSQL pg_hint_plan, MySQL/MariaDB /*+ ... */) rather than a
structural clause. The engine folds every variant into that comment. The safe default is
false.
bool SupportsInlineHints { get; }
Property Value
SupportsInsertIgnore
Whether the dialect can skip conflicting rows with its INSERT OR IGNORE/INSERT IGNORE
head (SQLite, MySQL, MariaDB; ClickHouse opts in as a no-op because it has no uniqueness).
Declared as a default interface method returning false so existing external implementations
keep compiling; a dialect that opts in also overrides MakeInsertIgnoreInto(KeywordCase).
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.
bool SupportsIntersectExceptAll { get; }
Property Value
SupportsJoinHints
True when the provider can render a hint attached to a specific join inside the join clause
(SQL Server INNER LOOP JOIN). The safe default is false; a command that carries a
join hint is rejected by the SQL builder on a dialect that does not opt in.
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.
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.
bool SupportsJson { get; }
Property Value
SupportsJsonExtract
True when the provider can render the JSON functions over JSON stored in a text column or a native
JSON column: the JSONExtract*/JSONHas and visitParamExtract* families
(ClickHouseFunctions.json_extract_/visit_param_extract_), the JSONPath scalars
JSON_VALUE/JSON_QUERY/JSON_EXISTS
(ClickHouseFunctions.json_value/json_query/json_exists) and the native-JSON
functions JSONAllPaths/JSONAllPathsWithTypes/toJSONString
(ClickHouseFunctions.json_all_paths/json_all_paths_with_types/to_json_string).
The native-JSON functions require a native JSON-valued argument (a String column needs
CAST(col AS JSON)); JSONAllPathsWithTypes returns Map(String, String), surfaced
as a Dictionary<TKey, TValue>.
This is distinct from the PostgreSQL JSON type (SupportsJson) and the SQL
Server/MySQL text-JSON functions (SupportsTextJson). The safe default is
false; ClickHouse opts in today.
bool SupportsJsonExtract { get; }
Property Value
SupportsLastInsertId
Whether the dialect can return the last generated identity through a separate scalar query
(LAST_INSERT_ID()) rather than a clause on the insert (MySQL, MariaDB). Declared as a
default interface method returning false so existing external implementations keep
compiling; a dialect that opts in also overrides MakeLastInsertId(KeywordCase).
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.
bool SupportsLinkedServer { get; }
Property Value
SupportsMerge
Whether the dialect expresses a key upsert as a full MERGE statement (SQL Server).
Declared as a default interface method returning false so existing external
implementations keep compiling; a dialect that opts in also overrides MakeMerge(string, IReadOnlyList<string>, IReadOnlyList<string>, IReadOnlyList<string>, string, KeywordCase, IReadOnlyList<string>?).
bool SupportsMerge { get; }
Property Value
SupportsMergeBySourceDelete
Whether the dialect accepts a WHEN NOT MATCHED BY SOURCE branch (SQL Server only).
Declared as a default interface method returning false.
bool SupportsMergeBySourceDelete { get; }
Property Value
SupportsMergeConditionalBranches
Whether a general MERGE accepts a search condition: an explicit ON <condition>
and/or a WHEN ... AND <condition> branch condition (SQL Server, PostgreSQL).
Declared as a default interface method returning false.
bool SupportsMergeConditionalBranches { get; }
Property Value
SupportsMergeDelete
Whether the dialect accepts a WHEN MATCHED THEN DELETE branch in a general MERGE
(SQL Server, PostgreSQL). Declared as a default interface method returning false.
bool SupportsMergeDelete { get; }
Property Value
SupportsMergeDoNothing
Whether a general MERGE accepts a THEN DO NOTHING branch (PostgreSQL only; SQL
Server has no DO NOTHING action). Declared as a default interface method returning
false.
bool SupportsMergeDoNothing { get; }
Property Value
SupportsMergeStatement
Whether the dialect renders a general, multi-branch MERGE statement (SQL Server,
PostgreSQL 15+). Declared as a default interface method returning false so existing
external implementations keep compiling.
bool SupportsMergeStatement { get; }
Property Value
SupportsMergeTargetQualification
Whether a general MERGE qualifies its target columns with the target alias in the
UPDATE SET list. Defaults to true (SQL Server); PostgreSQL overrides it to
false because its MERGE forbids qualifying a target column.
bool SupportsMergeTargetQualification { get; }
Property Value
SupportsNamedWindows
True when the provider can declare named windows (WINDOW w AS (...)) and reference them
with OVER w. The safe default is false; PostgreSQL, MySQL, MariaDB, ClickHouse and
SQLite opt in, while SQL Server has no WINDOW clause.
bool SupportsNamedWindows { get; }
Property Value
SupportsNativeDuration
True when the provider has a native duration/time-of-day type that the driver exposes as
TimeSpan (PostgreSQL interval, MySQL/MariaDB TIME). When
false, a TimeSpan column is stored in an integer column
in the unit declared by DurationAttribute (Ticks by
default) and read back through a conversion. Declared as a default interface method so that
existing external implementations keep compiling and keep their previous (native) behaviour.
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.
bool SupportsNthValue { get; }
Property Value
SupportsNullsOrdering
True when the provider understands the native NULLS FIRST/NULLS LAST ordering
modifier, which the SQLite, PostgreSQL and ClickHouse dialects opt into. The safe default is
false: a provider that does not opt in gets the portable CASE emulation from
RenderOrderBy(string, OrderDirection, NullsPosition). Declared as a default interface member so existing external
implementations keep compiling without a new abstract obligation.
bool SupportsNullsOrdering { get; }
Property Value
SupportsOnConflict
Whether the dialect expresses a key upsert as
INSERT ... ON CONFLICT (<keys>) DO UPDATE SET ... (PostgreSQL, SQLite 3.24+).
Declared as a default interface method returning false so existing external
implementations keep compiling.
bool SupportsOnConflict { get; }
Property Value
SupportsOnConflictDoNothing
Whether the dialect can skip conflicting rows with a trailing ON CONFLICT DO NOTHING
(PostgreSQL, SQLite 3.24+). Declared as a default interface method returning false so
existing external implementations keep compiling; a dialect that opts in also overrides
MakeOnConflictDoNothing(KeywordCase).
bool SupportsOnConflictDoNothing { get; }
Property Value
SupportsOnDuplicateKey
Whether the dialect expresses a key upsert as
INSERT ... ON DUPLICATE KEY UPDATE ... (MySQL, MariaDB). Declared as a default interface
method returning false so existing external implementations keep compiling.
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.
bool SupportsOrderedAggregates { get; }
Property Value
SupportsOrderedPercentiles
True when the provider expresses percentiles and the median as an ordered-set aggregate
(percentile_cont(fraction) within group (order by key)) rather than as a window function:
percentile_cont<T>(double, Expression<Func<T>>), percentile_disc<T>(double, Expression<Func<T>>)
and median<T>(Expression<Func<T>>). The safe default is false; only PostgreSQL opts
in today. This is deliberately separate from SupportsOrderedAggregates, which also
covers non-percentile members (mode), and from SupportsPercentileWindow,
which is the analytic shape. Declared as a default interface member so existing external
implementations keep compiling.
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.
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).
bool SupportsOrdinalLike { get; }
Property Value
SupportsOutput
Whether the dialect can place an OUTPUT inserted.<column> clause on an
INSERT so the statement returns the generated column (SQL Server). Declared as a default
interface method returning false so existing external implementations keep compiling; a
dialect that opts in also overrides MakeOutput(IReadOnlyList<string>, KeywordCase).
bool SupportsOutput { get; }
Property Value
SupportsOutputInto
Whether the dialect can place an OUTPUT inserted.<column> ... INTO <target>(columns)
clause on a data-modifying statement so the written rows land in an existing table instead of the
client (SQL Server). Declared as a default interface method returning false so existing
external implementations keep compiling; a dialect that opts in also uses MakeOutputInto(IReadOnlyList<string>, string, IReadOnlyList<string>, KeywordCase).
bool SupportsOutputInto { get; }
Property Value
SupportsPasteJoin
True when the provider understands the ClickHouse PASTE JOIN kind
(Paste), a position-based join with no ON condition. Declared as a
default interface method returning false so existing external implementations keep
compiling; only ClickHouse opts in today.
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.
bool SupportsPercentRankCumeDist { get; }
Property Value
SupportsPercentileWindow
True when the provider can render the window (analytic) percentile functions
percentile_cont(fraction)/percentile_disc(fraction) as
name(f) within group (order by value) over (...). The safe default is false;
SQL Server and MariaDB opt in. PostgreSQL expresses percentiles as an ordered-set aggregate instead
(SupportsOrderedAggregates, PostgresFunctions.percentile_cont), and
MySQL/SQLite/ClickHouse cannot express the window form.
bool SupportsPercentileWindow { get; }
Property Value
SupportsPostgresJsonSql
True when the provider can render the PostgreSQL JSON surface: the json/jsonb functions
and the access/containment operators translated by JsonSqlTranslator. The safe default is
false; only PostgreSQL opts in. Declared as a default interface method so existing external
implementations keep compiling and so a provider with native JSON storage (ClickHouse) does not
accidentally admit PostgreSQL JSON syntax.
bool SupportsPostgresJsonSql { get; }
Property Value
SupportsPreWhere
Whether the dialect supports the PREWHERE clause (ClickHouse). When false, a command
that carries one is rejected when its SQL is built.
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.
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.
bool SupportsQueryHints { get; }
Property Value
SupportsRandomSeed
True when the provider can set the seed of its session random generator as a separate side
effect (setseed(double?)). The safe default is false;
only PostgreSQL has a standalone setseed (MySQL/MariaDB and SQL Server combine seeding
with the value-returning RAND).
bool SupportsRandomSeed { get; }
Property Value
SupportsRangeColumns
True when the provider can store a Range<T> as a pair of scalar columns declared with RangeColumnsAttribute and translate the range surface over that pair. The safe default is false; PostgreSQL stores ranges natively (SupportsRanges) and does not need the pair, while the providers without a native range type opt in. Declared as a default interface method so existing external implementations keep compiling.
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.
bool SupportsRanges { get; }
Property Value
SupportsRawSqlSource
True when the provider can use a raw SQL fragment as a composable FROM source rendered as a
derived table ((<sql>) AS alias; see FromSql(IDataContext, string, object?)). The
safe default is false; a provider that leaves it false rejects such a source with a
clear NotSupportedException.
bool SupportsRawSqlSource { get; }
Property Value
SupportsRecursiveCte
Whether the dialect can render a recursive common table expression produced through the new
typed API (AsRecursiveCte). Declared as a default interface method returning false
so an external implementation fails closed. The relational dialects opt in; ClickHouse, whose
dialect has no recursive WITH, overrides it to false. This flag gates only the new
typed recursive API: a legacy WithRecursive declaration is never checked against it.
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).
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.
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.
bool SupportsRegressionAggregates { get; }
Property Value
SupportsReturning
Whether the dialect can append RETURNING <columns> to an INSERT so the
statement returns the generated column (PostgreSQL, SQLite 3.35+). Declared as a default
interface method returning false so existing external implementations keep compiling; a
dialect that opts in also overrides MakeReturning(IReadOnlyList<string>, KeywordCase).
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.
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).
bool SupportsRollup { get; }
Property Value
SupportsSample
Whether the dialect supports the SAMPLE ratio [OFFSET offset] table modifier (ClickHouse).
bool SupportsSample { get; }
Property Value
SupportsSavepoints
True when the provider supports savepoints inside an ADO.NET transaction — create, roll back to
and release a named point (SAVEPOINT/ROLLBACK TO SAVEPOINT/RELEASE SAVEPOINT,
or the SQL Server SAVE TRANSACTION/ROLLBACK TRANSACTION forms). Declared as a default
interface method returning false so existing external implementations keep compiling;
SQLite, PostgreSQL, SQL Server and MySQL opt in, MariaDB inherits MySQL's value, and ClickHouse
has no transaction at all.
bool SupportsSavepoints { get; }
Property Value
SupportsSelectWhereMinMax
Whether the dialect can express the SelectWhereMax/SelectWhereMin row-selection
request from NextORM.Core.ExtremeRowClause. When false, a command that
carries one is rejected when its SQL is built. Declared as a default interface method returning
false so existing external implementations keep compiling; every built-in dialect opts in.
bool SupportsSelectWhereMinMax { get; }
Property Value
SupportsSemiAntiJoin
True when the provider understands the ClickHouse SEMI/ANTI join kinds
(Semi/Anti), which return only the left-hand
columns. Declared as a default interface method returning false so existing external
implementations keep compiling; only ClickHouse opts in today.
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.
bool SupportsSequentialAccess { get; }
Property Value
SupportsSettings
Whether the dialect supports the trailing SETTINGS clause (ClickHouse). When false, a
command that carries settings is rejected when its SQL is built.
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.
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.
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.
bool SupportsStatisticalAggregates { get; }
Property Value
SupportsStoredProcedures
Whether the provider can execute a stored procedure through
DataContext.ExecuteProcedure (command type StoredProcedure).
SQL Server, PostgreSQL and MySQL/MariaDB opt in; SQLite and ClickHouse have no stored procedures
and leave it false, so the call is rejected before a connection is opened. Declared as a
default interface method returning false so existing external implementations keep
compiling.
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.
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.
bool SupportsStringArrayAggregates { get; }
Property Value
SupportsSubQueryHints
True when the provider can render a hint attached to a derived-table subquery (PostgreSQL
pg_hint_plan and MySQL/MariaDB optimizer hints, through the statement-level inline hint
comment). SQL Server has no such form (a query hint cannot be appended to a subselect), so its
default is false and a command carrying a subquery hint is rejected there.
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.
bool SupportsTableHints { get; }
Property Value
SupportsTableValuedParameters
Whether the provider can bind a table-valued parameter (ProcedureParameter.Table<T>(name, rows)).
SQL Server binds it natively through a user-defined table type; PostgreSQL, MySQL/MariaDB and
SQLite emulate it (typed array or JSON document) and ClickHouse with a bound
Array(T)/Array(Tuple(...)) expanded server-side with arrayJoin(@p). Only the
in-memory provider leaves it false. Declared as a default interface method returning
false so existing external implementations keep compiling.
bool SupportsTableValuedParameters { get; }
Property Value
SupportsTablesInScopeHints
True when the provider can render a hint on every physical table in the command's scope. On SQL
Server that is a WITH (...) table hint on each table; the inline-comment dialects fold the
same hint into the statement-level /*+ ... */. The safe default is false.
bool SupportsTablesInScopeHints { get; }
Property Value
SupportsTemporalTable
Whether the dialect supports the FOR SYSTEM_TIME temporal-table clause. When false,
a command that carries a TemporalClause is rejected when its SQL is built. SQL
Server and MariaDB opt in.
bool SupportsTemporalTable { get; }
Property Value
SupportsTemporaryCreateTableAsSelect
Whether the dialect can materialise a query into a temporary table (ToTempTable).
Declared as a default interface method returning SupportsCreateTableAsSelect;
PostgreSQL, SQLite, MySQL and MariaDB keep it, while SQL Server (a temporary table is
ToTable("#name")) and ClickHouse (a temporary table accepts no AS SELECT) opt out.
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.
bool SupportsTextJson { get; }
Property Value
SupportsTextSearchFunctions
True when the provider can render the native text-search scalar surface of
PostgresFunctions (to_tsvector, to_tsquery, plainto_tsquery,
phraseto_tsquery, websearch_to_tsquery, ts_rank, ts_headline and the
@@ match operator). The safe default is false; only PostgreSQL opts in. The
cross-provider contains/freetext predicates are gated separately by
SupportsFullText.
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.
bool SupportsTransactions { get; }
Property Value
SupportsTruncate
Whether the dialect has a native TRUNCATE TABLE statement. Declared as a default interface
method returning false; SQLite has no TRUNCATE (use DELETE), so it keeps the
default.
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.
bool SupportsTupleFunctions { get; }
Property Value
SupportsUpdate
Whether the dialect can execute an UPDATE and report the affected-row count. Declared as a
default interface method returning true; ClickHouse keeps it true but renders its
ALTER TABLE ... UPDATE mutation, which waits for the mutation
(SETTINGS mutations_sync = 1) yet reports no affected-row count. The native head is rendered
by MakeUpdateHead(string, KeywordCase).
bool SupportsUpdate { get; }
Property Value
SupportsUpdateJoin
Whether the dialect can update rows of one table based on a join (a native multi-table
UPDATE). Declared as a default interface method returning false; PostgreSQL, SQLite,
SQL Server, MySQL and MariaDB override it. ClickHouse's ALTER TABLE ... UPDATE mutation
cannot reference other tables, so it keeps the default.
bool SupportsUpdateJoin { get; }
Property Value
SupportsUpdateJoinReturning
Whether the dialect can return the affected rows of a multi-table UPDATE ... FROM ... JOIN
through a RETURNING clause (PostgreSQL). Declared as a default interface method returning
false so existing external implementations keep compiling.
bool SupportsUpdateJoinReturning { get; }
Property Value
SupportsUpdateReturning
Whether the dialect can append RETURNING <columns> to a single-table UPDATE.
Defaults to SupportsReturning so a dialect whose RETURNING support covers
every statement keeps working unchanged. Overridden separately where the server's
UPDATE ... RETURNING appears at a different version than INSERT/DELETE
(MariaDB 13.0+). Declared as a default interface method so existing external implementations
keep compiling.
bool SupportsUpdateReturning { get; }
Property Value
SupportsWindowFrameExclusion
True when the provider can render a window frame exclusion
(EXCLUDE CURRENT ROW/GROUP/TIES/NO OTHERS). The safe default is
false; PostgreSQL and SQLite opt in, while SQL Server, MySQL, MariaDB and ClickHouse do
not implement the clause.
bool SupportsWindowFrameExclusion { get; }
Property Value
SupportsWindowFrameGroups
True when the provider can render the GROUPS window frame unit (peer groups rather than
physical rows or ordering values). The safe default is false; PostgreSQL, ClickHouse and
SQLite opt in, while SQL Server, MySQL and MariaDB only support ROWS/RANGE.
bool SupportsWindowFrameGroups { get; }
Property Value
SupportsWithTies
Whether the dialect supports WITH TIES on a page request (FETCH ... WITH TIES,
TOP(n) WITH TIES). When false, a command whose HasWithTies is set
is rejected when its SQL is built. PostgreSQL and SQL Server opt in.
bool SupportsWithTies { get; }
Property Value
TableSample
The provider's renderer for TABLESAMPLE; null means the provider cannot express it.
Declared as a default interface method so that existing external implementations keep compiling.
ITableSampleMethods? TableSample { get; }
Property Value
TopKAggregates
The provider's renderer for the ClickHouse parameterised top-K aggregates
(topK(N)(value), topKWeighted(N)(value, weight)); null means the provider
cannot express them. Declared as a default interface method so that existing external
implementations keep compiling.
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.
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.
IUniqAggregateRenderer? UniqAggregates { get; }
Property Value
UpdateJoinRequiresFrom
Whether MakeUpdateJoin(string, string, string, string, string, string, string?, KeywordCase) must be given the FROM spelling (PostgreSQL and
SQLite): the target stays out of the source list, the joined tables are listed separately and the
join conditions are folded into the WHERE so they can reference the target alias. When
false, the alias spelling is used (SQL Server UPDATE <alias> ... FROM,
MySQL/MariaDB UPDATE ... JOIN ... SET). Defaults to false.
bool UpdateJoinRequiresFrom { get; }
Property Value
UpdateRequiresWhere
Whether the dialect requires a WHERE clause on every update (ClickHouse's
ALTER TABLE ... UPDATE does). An update without a predicate then renders a trivially true
filter (WHERE 1). Defaults to false.
bool UpdateRequiresWhere { get; }
Property Value
UuidGenerators
The provider's UUID generator surface (gen_random_uuid, uuidv7). null means
the provider cannot express the family; the object itself answers per name because SQL Server and
MariaDB can express only one of the two. Declared as a default interface method so that existing
external implementations keep compiling.
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.
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.
bool WrapsCountResult { get; }
Property Value
XmlFunctions
The provider's renderer for the postfix XML data-type methods (value/query/
exist). null means the provider cannot express them. Declared as a default
interface method so that existing external implementations keep compiling.
IXmlFunctions? XmlFunctions { get; }
Property Value
Methods
Escape(string)
Quotes an identifier (alias, keyword).
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.
string? GetPagingOrderBy(QueryCommand queryCommand)
Parameters
queryCommandQueryCommand
Returns
MakeAggregate(string)
Maps an aggregate function name to the provider specific one, e.g. stdev -> stddev.
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.
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.
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.
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.
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.
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.
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)
Renders base64_decode(value) over the already-rendered operand. Reached only when
SupportsBase64Decode is true. A literal NULL operand arrives as the bare token
null and must be replaced by the provider's typed text NULL. The default rejects the
call.
string MakeBase64Decode(string value)
Parameters
valuestring
Returns
MakeBase64Encode(string)
Renders base64_encode(value) over the already-rendered operand. Reached only when
SupportsBase64Encode is true. A literal NULL operand arrives as the bare token
null and must be replaced by the provider's typed binary NULL so the argument keeps its
SQL input type. The default rejects the call.
string MakeBase64Encode(string value)
Parameters
valuestring
Returns
MakeBool(bool)
Renders the SQL literal for a boolean value.
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.
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.
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.
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.
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.
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.
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.
string MakeColumnAlias(string? colAlias, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
colAliasstringkeywordCaseKeywordCase
Returns
MakeColumnDefault(KeywordCase)
Renders the DEFAULT keyword as a value in the VALUES list. Only called when
SupportsColumnDefault is true.
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.
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.
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.
string MakeCount(bool distinct, bool big)
Parameters
Returns
MakeCreateTableAsSelect(CreateTableAsClause, string, KeywordCase)
Renders a CREATE [TEMPORARY] TABLE ... AS SELECT statement over the already-resolved,
optionally quoted clause and the already-rendered selectSql
body. Only called through a dialect that set SupportsCreateTableAsSelect; the
optional parts (column list, ON COMMIT, WITH NO DATA) are gated by their own flags
before this is reached.
string MakeCreateTableAsSelect(CreateTableAsClause clause, string selectSql, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
clauseCreateTableAsClauseThe resolved clause options.
selectSqlstringThe rendered body query.
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered statement.
MakeCreateTableAsSelectInto(CreateTableAsClause, KeywordCase)
Renders the clause that introduces the target of a SELECT ... INTO materialisation (for
example into [target]), which the statement builder inserts into the select list. Only
called through a dialect that set CreateTableAsSelectUsesSelectInto; the default
throws.
string MakeCreateTableAsSelectInto(CreateTableAsClause clause, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
clauseCreateTableAsClauseThe resolved clause options.
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered
INTOclause.
MakeCryptGenRandom(string)
Renders crypt_gen_random(length) over the already-rendered operand. Reached only when
SupportsCryptGenRandom is true. A literal NULL operand arrives as the bare
token null and must be replaced by the provider's typed integer NULL. The default
rejects the call.
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.
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.
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.
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.
string MakeDateDiffBig(string field, string start, string end)
Parameters
Returns
MakeDateFromParts(string, string, string)
Renders a date built from its already-rendered year/month/
day parts.
string MakeDateFromParts(string year, string month, string day)
Parameters
Returns
MakeDatePart(string, string)
Renders a date/time part extraction (year, month, day, hour, ...).
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.
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.
string MakeDateTimeOffsetNow(bool utc)
Parameters
utcbool
Returns
MakeDateTrunc(string, string)
Renders date_trunc(field, value); field is a validated date-part name.
string MakeDateTrunc(string field, string value)
Parameters
Returns
MakeDefaultValues(KeywordCase)
Renders the all-defaults row form that follows the quoted table name: the ANSI
DEFAULT VALUES by default, or the MySQL/MariaDB () VALUES () where the dialect
overrides it. Only called when SupportsDefaultValues is true.
string MakeDefaultValues(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeDeleteHead(string, KeywordCase)
Renders the head of a DELETE statement up to (but not including) its filter, over the
already-resolved, quoted target table. Defaults to the ANSI DELETE FROM <table>;
ClickHouse overrides it with the ALTER TABLE <table> DELETE mutation head.
string MakeDeleteHead(string table, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tablestringThe quoted target table.
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered delete head.
MakeDeleteJoin(string, string, string, string, string, string?, KeywordCase)
Renders a multi-table DELETE. Only called when SupportsDeleteJoin is
true. The renderer supplies both spellings so the dialect can pick its native form: the
alias style (DELETE <alias> FROM <fromAndJoins>, SQL Server/MySQL/MariaDB) and
the USING style (DELETE FROM ... USING ..., PostgreSQL), where the join conditions
are folded into the WHERE so they can reference the target alias.
string MakeDeleteJoin(string target, string targetAlias, string fromAndJoins, string usingSources, string joinConditions, string? whereSql, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
targetstringThe target table with literal identifiers (already quoted), without an alias.
targetAliasstringThe alias assigned to the target table, already escaped for the dialect.
fromAndJoinsstringThe alias-style source:
<target> AS a JOIN <b> AS b ON ....usingSourcesstringThe
USING-style source list:<b> AS b[, <c> AS c ...].joinConditionsstringThe rendered join
ONconditions, combined withand, without a leadingWHERE.whereSqlstringThe rendered user
WHEREcondition, or null when there is none.keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered multi-table
DELETE.
Exceptions
- NotSupportedException
The dialect has no native multi-table
DELETE.
MakeDeleteSuffix(KeywordCase)
Renders a dialect suffix appended after the delete's filter (ClickHouse's
SETTINGS mutations_sync = 1), or null when there is none. Defaults to
null.
string? MakeDeleteSuffix(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
MakeDeletedOutput(IReadOnlyList<string>, KeywordCase)
Renders OUTPUT deleted.<column> ... for a DELETE (SQL Server reads the removed
row through deleted). Only called when SupportsOutput is true.
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>(targetColumns) clause of a
DELETE (SQL Server reads the removed row through the deleted alias). Only called when
SupportsOutputInto is true.
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 a ClickHouse dictionary function over the already-rendered args. Only
called when SupportsDictionaries is true. The default renders
name(arg1, arg2, ...); ClickHouse maps the snake_case name to its camel-case spelling.
string MakeDictionaryFunction(string name, IReadOnlyList<string> args)
Parameters
namestringargsIReadOnlyList<string>
Returns
MakeDurationType(DurationUnit?, int)
Renders the column type of a TimeSpan property: the native type when
SupportsNativeDuration is true, otherwise an integer type wide enough for
unit. unit is null when the property does not
declare one. Declared as a default interface method so that existing external implementations
keep compiling.
string MakeDurationType(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.
MakeEndOfMonth(string)
Renders the last day of the month of the already-rendered value.
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.
string MakeFilteredStringAgg(string value, string delimiter, string predicate)
Parameters
Returns
MakeFinal(KeywordCase)
Renders the FINAL modifier. Only reached through a dialect that set SupportsFinal.
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.
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.
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.
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.
string MakeFunction(string name, string? schema)
Parameters
Returns
MakeGreatest(IReadOnlyList<string>)
Renders greatest(...) over the already-rendered arguments.
string MakeGreatest(IReadOnlyList<string> args)
Parameters
argsIReadOnlyList<string>
Returns
MakeGroupByTotals(string, KeywordCase)
Appends the WITH TOTALS modifier to an already-rendered grouping clause. Only called when
SupportsGroupByWithTotals is true. The default returns
grouping unchanged; ClickHouse appends with totals.
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.
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).
string MakeGroupingSets(IReadOnlyList<string> groupingSets, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
groupingSetsIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeIdentityFunction(KeywordCase)
Renders the scalar query that returns the last generated identity of the current session without
naming the identity column. Only called when SupportsIdentityFunction is
true; defaults to MakeLastInsertId(KeywordCase).
string MakeIdentityFunction(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeIdentityInsertOff(string, KeywordCase)
Renders the statement that disables explicit identity values for table. Only
called when RequiresIdentityInsertToggle is true.
string MakeIdentityInsertOff(string table, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tablestringkeywordCaseKeywordCase
Returns
MakeIdentityInsertOn(string, KeywordCase)
Renders the statement that enables explicit identity values for table. Only
called when RequiresIdentityInsertToggle is true.
string MakeIdentityInsertOn(string table, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tablestringkeywordCaseKeywordCase
Returns
MakeInsertIgnoreInto(KeywordCase)
Renders the INSERT head that skips conflicting rows: insert or ignore into by
default, overridden with insert ignore into by MySQL/MariaDB and with a plain
insert into by ClickHouse (no uniqueness, so every row is written). Only called when
SupportsInsertIgnore is true.
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.
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.
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).
string MakeJoinKeyword(JoinType joinType, JoinStrictness strictness, bool isGlobal, string? hint, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
joinTypeJoinTypestrictnessJoinStrictnessisGlobalboolhintstringkeywordCaseKeywordCase
Returns
MakeJsonExtract(string, IReadOnlyList<string>)
Renders a ClickHouse JSON function over the already-rendered args: the
JSONExtract*/visitParamExtract* family, the JSONPath scalars
(JSON_VALUE/JSON_QUERY/JSON_EXISTS) and the native-JSON functions
(JSONAllPaths/JSONAllPathsWithTypes/toJSONString). Only called when
SupportsJsonExtract is true. The default renders
name(arg1, arg2, ...); ClickHouse maps the snake_case name to its native spelling and
casts the unsigned results it cannot materialise.
string MakeJsonExtract(string name, IReadOnlyList<string> args)
Parameters
namestringargsIReadOnlyList<string>
Returns
MakeLastInsertId(KeywordCase)
Renders the scalar query that returns the last generated identity of the current session. Only
called when SupportsLastInsertId is true.
string MakeLastInsertId(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeLeast(IReadOnlyList<string>)
Renders least(...) over the already-rendered arguments.
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.
string MakeLikeEscape(string escapeChar, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
escapeCharstringkeywordCaseKeywordCase
Returns
MakeLower(string)
Renders a lower case conversion.
string MakeLower(string value)
Parameters
valuestring
Returns
MakeMathFunction(string, IReadOnlyList<string>)
Renders a math function call with the given already-rendered arguments.
string MakeMathFunction(string name, IReadOnlyList<string> args)
Parameters
namestringargsIReadOnlyList<string>
Returns
MakeMathFunction(string, IReadOnlyList<string>, IReadOnlyList<Type>)
Renders a math function call together with the static CLR types of the arguments. A dialect
whose native function has a more specific overload set than ANSI uses the types to pick the
right form (PostgreSQL's two-argument round only accepts numeric, so a
double/float argument has to be cast). The default ignores the
types and delegates to MakeMathFunction(string, IReadOnlyList<string>).
string MakeMathFunction(string name, IReadOnlyList<string> args, IReadOnlyList<Type> argTypes)
Parameters
namestringargsIReadOnlyList<string>argTypesIReadOnlyList<Type>
Returns
Remarks
Declared as a default interface method so that existing external ISqlDialect implementations that do not render SQL themselves keep compiling.
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).
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 statement over the already-rendered pieces. Only called when
SupportsMerge is true.
string MakeMerge(string target, IReadOnlyList<string> columns, IReadOnlyList<string> keys, IReadOnlyList<string> updateColumns, string valuesRows, KeywordCase keywordCase = KeywordCase.Lower, IReadOnlyList<string>? returningColumns = null)
Parameters
targetstringThe quoted target table.
columnsIReadOnlyList<string>The quoted written columns, in insert order.
keysIReadOnlyList<string>The quoted match-key columns.
updateColumnsIReadOnlyList<string>The quoted non-key columns updated on a match.
valuesRowsstringThe rendered
(<values>), (<values>)rows of the derived source.keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
returningColumnsIReadOnlyList<string>The quoted columns to return through
OUTPUT(SQL Server), or null when the key upsert returns no rows.
Returns
- string
The rendered
MERGEstatement, terminated by a semicolon.
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.
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 a
terminating semicolon.
string MakeMergeStatementTerminator(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeNow(bool)
Renders the current local or UTC date/time.
string MakeNow(bool utc)
Parameters
utcbool
Returns
MakeNullIf(string, string)
Renders nullif(value, other). ANSI and portable, so every dialect accepts it.
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.
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 the conflict target and the start of the update list:
ON CONFLICT (<keys>) DO UPDATE SET . Only called when
SupportsOnConflict is true.
string MakeOnConflict(IReadOnlyList<string> keys, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keysIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeOnConflictDoNothing(KeywordCase)
Renders the trailing ON CONFLICT DO NOTHING that skips conflicting rows when the dialect
has no INSERT OR IGNORE head. Only called when SupportsOnConflictDoNothing
is true.
string MakeOnConflictDoNothing(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCase
Returns
MakeOnDuplicateKey(KeywordCase)
Renders the duplicate-key clause start ON DUPLICATE KEY UPDATE . Only called when
SupportsOnDuplicateKey is true.
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.
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.
string MakeOrdinal(string value, bool ignoreCase)
Parameters
Returns
MakeOutput(IReadOnlyList<string>, KeywordCase)
Renders the OUTPUT clause of an INSERT over the already-rendered
columns. Only called when SupportsOutput is true.
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>(targetColumns) clause of a
data-modifying statement, using the write-side inserted alias (insert, update). Only called
when SupportsOutputInto is true. The columns are the already-rendered output
columns; target and targetColumns are the target table and the
target columns they map to by position.
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 OVERRIDING SYSTEM VALUE clause PostgreSQL needs to write an explicit value to
a GENERATED ALWAYS AS IDENTITY column; the empty string when the dialect needs no clause
(SQLite/MySQL/MariaDB accept explicit identity values as-is, SQL Server uses a session toggle).
Only emitted when the insert writes identity columns.
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).
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.
void MakePage(Paging paging, StringBuilder sqlBuilder, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
pagingPagingsqlBuilderStringBuilderkeywordCaseKeywordCase
MakeParam(string)
Renders a parameter placeholder, e.g. @name or $name.
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.
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.
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.
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).
string MakeRepeat(string value, string count)
Parameters
Returns
MakeReplace(string, string, string)
Renders a string replace.
string MakeReplace(string value, string oldValue, string newValue)
Parameters
Returns
MakeResultColumnType(Type, bool)
Renders the native type of a result-schema column from its CLR type, using the provider's type
mapping. nullable is true when the CLR type is a nullable
value type (Nullable<T>), so a provider whose native type is not nullable by
default (ClickHouse) can wrap it. Only called when the provider supports the declared result
schema (see SupportsResultSchema(TableFunctionSchema)). The default unwraps the
nullable CLR type and delegates to MakeTypeName(Type).
string MakeResultColumnType(Type clrType, bool nullable)
Parameters
clrTypeTypeThe CLR type of the result column.
nullableboolWhether the CLR type is a nullable value type.
Returns
- string
The provider type name.
MakeReturning(IReadOnlyList<string>, KeywordCase)
Renders the RETURNING clause of an INSERT over the already-rendered
columns. Only called when SupportsReturning is true.
string MakeReturning(IReadOnlyList<string> columns, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
columnsIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeSample(double, double, KeywordCase)
Renders the SAMPLE modifier. Only reached through a dialect that set SupportsSample.
string MakeSample(double ratio, double offset, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
ratiodoubleoffsetdoublekeywordCaseKeywordCase
Returns
MakeSettings(IReadOnlyList<KeyValuePair<string, string>>, KeywordCase)
Renders the trailing SETTINGS clause. Only reached through a dialect that set SupportsSettings.
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.
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.
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.
string MakeStringLastIndexOf(string value, string substring)
Parameters
Returns
MakeStringLength(string)
Renders a string length function over value (SQL Server len, others length).
string MakeStringLength(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).
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.
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.
string MakeSubstring(string value, string start, string? length)
Parameters
Returns
MakeTableAlias(string, KeywordCase)
Renders the alias clause for a table source (AS alias).
string MakeTableAlias(string tableAlias, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tableAliasstringkeywordCaseKeywordCase
Returns
MakeTableFunctionAlias(string, string?, KeywordCase)
Renders the alias clause of a table-valued function source. When
columnDefinitionList is not null, the alias carries the
declared result schema (as x(a int, b text), PostgreSQL); the default ignores it and
delegates to MakeTableAlias(string, KeywordCase). Only called when the provider supports
AliasColumnList (see
SupportsResultSchema(TableFunctionSchema)) and the function declares that form.
string MakeTableFunctionAlias(string tableAlias, string? columnDefinitionList, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tableAliasstringThe generated source alias.
columnDefinitionListstringThe rendered column-definition list, or null.
keywordCaseKeywordCaseThe keyword casing.
Returns
- string
The alias clause text.
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.
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.
string MakeTablesInScopeHints(IReadOnlyList<string> hints, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
hintsIReadOnlyList<string>keywordCaseKeywordCase
Returns
MakeTemporalTable(TemporalClause, KeywordCase)
Renders the FOR SYSTEM_TIME clause. The standard SQL:2011 syntax is shared by SQL Server
and MariaDB; only reached through a dialect that set SupportsTemporalTable.
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.
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.
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.
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.
string MakeTrim(string value, StringTrimKind kind)
Parameters
valuestringkindStringTrimKind
Returns
MakeTruncate(string, KeywordCase)
Renders the native full-table truncation over the already-resolved, quoted target table. Only
called when SupportsTruncate is true.
string MakeTruncate(string table, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tablestringThe quoted target table.
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered
TRUNCATE TABLEstatement.
MakeTryCast(string, Type)
Renders a SQL Server TRY_CAST of expression to the SQL type that the
closed target map assigns to targetType: the value is SQL NULL when the
conversion is invalid. Providers without the function keep the rejecting default here rather
than falling back to MakeTypeName(Type), whose open name fall-back would emit SQL the
server rejects; only SQL Server's closed map may answer. A target outside the map is refused
before the command is prepared.
string MakeTryCast(string expression, Type targetType)
Parameters
expressionstringThe already-rendered source expression.
targetTypeTypeThe CLR conversion target (possibly Nullable<T>).
Returns
- string
The complete
try_cast(… as …)expression.
MakeTryConvert(string, Type, string?)
Renders a SQL Server TRY_CONVERT of expression to the closed-map SQL
type of targetType. style is the already-rendered native
style argument, or null for the no-style form; a supplied SQL NULL style is a
non-null string and keeps the server's native NULL-style semantics, which the engine applies as a
NULL result even for a convertible value. Same rejection rules as
MakeTryCast(string, Type).
string MakeTryConvert(string expression, Type targetType, string? style)
Parameters
expressionstringThe already-rendered source expression.
targetTypeTypeThe CLR conversion target (possibly Nullable<T>).
stylestringThe rendered style argument, or null when omitted.
Returns
- string
The complete
try_convert(…, …)expression.
MakeTypeName(Type)
SQL type name used when a CLR conversion has to be rendered as a database cast.
string MakeTypeName(Type type)
Parameters
typeType
Returns
MakeUpdateHead(string, KeywordCase)
Renders the head of an UPDATE statement up to (but not including) its SET list, over
the already-resolved, quoted target table. Defaults to the ANSI UPDATE <table> SET ;
ClickHouse overrides it with ALTER TABLE <table> UPDATE . Only reached through a
dialect that kept SupportsUpdate true.
string MakeUpdateHead(string table, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
tablestringThe quoted target table.
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered update head.
MakeUpdateJoin(string, string, string, string, string, string, string?, KeywordCase)
Renders a multi-table UPDATE. Only called when SupportsUpdateJoin is
true. The renderer supplies both spellings so the dialect can pick its native form: the
alias style (<target> AS a JOIN <b> AS b ON ..., SQL Server/MySQL/MariaDB) and
the FROM style (<b> AS b, ... plus join conditions, PostgreSQL/SQLite). The
SET list is rendered once and references the target through its alias.
string MakeUpdateJoin(string target, string targetAlias, string assignments, string fromAndJoins, string usingSources, string joinConditions, string? whereSql, KeywordCase keywordCase = KeywordCase.Lower)
Parameters
targetstringThe target table with literal identifiers (already quoted), without an alias.
targetAliasstringThe alias assigned to the target table, already escaped for the dialect.
assignmentsstringThe rendered
<column> = <value>list, without theSETkeyword.fromAndJoinsstringThe alias-style source:
<target> AS a JOIN <b> AS b ON ....usingSourcesstringThe
FROM-style source list:<b> AS b[, <c> AS c ...].joinConditionsstringThe rendered join
ONconditions, combined withand, without a leadingWHERE.whereSqlstringThe rendered user
WHEREcondition, or null when there is none.keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
- string
The rendered multi-table
UPDATE.
Exceptions
- NotSupportedException
The dialect has no native multi-table
UPDATE.
MakeUpdateSuffix(KeywordCase)
Renders a dialect suffix appended after the update's filter (ClickHouse's
SETTINGS mutations_sync = 1), or null when there is none. Defaults to
null.
string? MakeUpdateSuffix(KeywordCase keywordCase = KeywordCase.Lower)
Parameters
keywordCaseKeywordCaseThe letter case in which SQL keywords are emitted.
Returns
MakeUpper(string)
Renders an upper case conversion.
string MakeUpper(string value)
Parameters
valuestring
Returns
MakeUpsertValueReference(string, KeywordCase)
Renders the right-hand side of an upsert assignment: the incoming (would-be inserted) value of
column as seen by the matched branch. Defaults to the ANSI
excluded.<column> form used by ON CONFLICT; MySQL and MariaDB override it with
VALUES(<column>). The excluded/values qualifier is an identifier or
function name, so it is not affected by keywordCase.
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.
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.
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.
string PromoteDateOperand(string field, string value)
Parameters
Returns
QuoteIdentifier(string)
Quotes a physical identifier (table or column name) with the provider's delimiter, doubling an
embedded delimiter. Used when identifier quoting is enabled on the context
(DataContextBuilder.UseQuotedIdentifiers) or on a single command
(WithQuotedIdentifiers). The default is the ANSI "name" form; a provider with a
different delimiter (SQL Server brackets, MySQL/MariaDB/ClickHouse backticks) overrides it.
Distinct from Escape(string), which quotes an alias/keyword for the provider and is single-quoted on SQLite (a valid alias but not a valid identifier). Declared as a default interface method so that existing external implementations keep compiling.
string QuoteIdentifier(string name)
Parameters
namestring
Returns
RenderOrderBy(string, OrderDirection, NullsPosition)
Renders one logical ORDER BY item for expressionSql with the requested
NULL placement. The default implementation emulates the placement with a CASE rank key
(CASE WHEN K IS NULL THEN n ELSE m END ASC, K, plus the descending suffix on the key only),
so the rank prefix stays ascending even for a descending key. Providers that opt into
SupportsNullsOrdering override it with the native NULLS FIRST/NULLS LAST
form. Default bypasses this renderer entirely; passing it here is an
error. The returned fragment may contain two physical sort keys but is consumed as one item, and a
parameterized key therefore occurs twice and must be bound twice.
string RenderOrderBy(string expressionSql, OrderDirection direction, NullsPosition nullsPosition)
Parameters
expressionSqlstringThe already-qualified, already-quoted key SQL.
directionOrderDirectionThe requested key direction; the emulated rank prefix ignores it.
nullsPositionNullsPosition
Returns
- string
The rendered ordering item.
Exceptions
- ArgumentOutOfRangeException
nullsPositionis not an explicit placement.
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.
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.
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.
bool SupportsDateAddField(string field)
Parameters
fieldstring
Returns
SupportsDateDiffField(string)
True when the provider accepts field as a date_diff part.
bool SupportsDateDiffField(string field)
Parameters
fieldstring
Returns
SupportsDatePart(string)
True when the provider accepts part as an extract/date_part
date part. The ANSI parts are accepted by default; a dialect adds the parts it can express
natively (quarter, week, dow, isodow, epoch) by overriding
this together with MakeDatePart(string, string).
bool SupportsDatePart(string part)
Parameters
partstring
Returns
SupportsDateTruncField(string)
True when the provider accepts field as a date_trunc part.
bool SupportsDateTruncField(string field)
Parameters
fieldstring
Returns
SupportsResultSchema(TableFunctionSchema)
True when the provider can render a table-function result schema derived from the mapped row
type in the requested placement form: as a leading structure argument
(ClickHouse values, LeadingArgument) or as an alias
column-definition list (PostgreSQL jsonb_to_record,
AliasColumnList). The safe default is false; a provider
that returns false for the declared form rejects such a source with a clear
NotSupportedException. Declared as a default interface method so existing
external implementations keep compiling.
bool SupportsResultSchema(TableFunctionSchema placement)
Parameters
placementTableFunctionSchemaThe declared result-schema form to render.
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.
bool SupportsTableFunction(string name)
Parameters
namestring
Returns
SupportsTemporalKind(TemporalKind)
Whether the dialect supports the given FOR SYSTEM_TIME kind. SQL Server supports every
kind; MariaDB has no CONTAINED IN. Only reached through a dialect that set
SupportsTemporalTable.
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.
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).
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.
string WrapTableFunction(string name, string call)
Parameters
Returns
WrapTableFunction(string, string, IReadOnlyList<string>)
Wraps the rendered table-function call with the structured, already-rendered arguments, or
returns it unchanged. A dialect that needs an individual argument intact (SQLite rewrites the
FTS5 fts5(table, query) placeholder to the native table(query) form) uses this
overload so it never has to reparse the serialized call text. The default forwards to
WrapTableFunction(string, string) so existing implementations keep compiling.
string WrapTableFunction(string name, string call, IReadOnlyList<string> arguments)
Parameters
namestringcallstringargumentsIReadOnlyList<string>