Table of Contents

Class SqlFunctions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Static entry point for SQL constructs that are written directly inside query expressions.

public static class SqlFunctions
Inheritance
SqlFunctions
Inherited Members

Remarks

Renamed from NORM (all-caps abbreviation). The nested function surfaces were renamed too: NORM_SQL → CommonFunctions, PG/MS/CLK → PostgresFunctions/SqlServerFunctions/ClickHouseFunctions. Method names intentionally mirror SQL tokens (count_big, @in, ...), which the .NET guidelines would not; see docs/specs/design/API-NAMING-REVIEW.md finding P1-10.

Properties

ClickHouse

Surface of the ClickHouse-only functions (the argMin/argMax, uniq*, parameterised quantile*/median and the anyLast aggregate, the string-JSON JSONExtract*/visitParamExtract* family plus the JSONPath json_value/json_query/json_exists scalars, the dictionary functions, the -If combinator, the distributed global_in predicate and the numbers/numbers_mt and zeros/zeros_mt table functions (plus generateRandom and the server/cluster table functions url/s3/file/remote/remoteSecure/cluster/clusterAllReplicas), the date conversion/part surface (toDate/toDateTime/toDate32, toYear/..., toStartOf*, toMonday, toYYYYMM/toYYYYMMDD, toUnixTimestamp), as well as the array functions over array columns (arrayJoin, length, has, indexOf, hasAny/hasAll, startsWith/endsWith/hasSubstr, arrayStringConcat, splitByChar, arraySort, arrayReverse, arrayDistinct). Every member is gated by a capability flag (SupportsArgMinMax, AggregateFilterStyle, …); other providers reject it with a clear message.

public static ClickHouseFunctions ClickHouse { get; }

Property Value

ClickHouseFunctions

MySql

Surface of the MySQL/MariaDB-only functions (the native string/conditional idioms, the %-templated date conversion and Unix-epoch functions, the hexadecimal hashes, the IPv4 conversion pair, the JSON mutation family and the binary UUID pair). Every member is gated per name by MySqlFunctions; other providers reject it with a clear message.

public static MySqlFunctions MySql { get; }

Property Value

MySqlFunctions

Postgres

Surface of the PostgreSQL-only functions (arrays, native JSON, the extended scalar library, PG-only aggregates and the generate_series/unnest table functions). Every member requires SupportsArrays or the matching capability flag; other providers reject it with a clear message.

public static PostgresFunctions Postgres { get; }

Property Value

PostgresFunctions

Sql

Cross-provider SQL function surface. The reference is only a marker inside a query expression: the SQL providers translate the call, and the in-memory provider rewrites the few members it can evaluate (collate(string?, string?)) before compiling the expression.

public static CommonFunctions Sql { get; }

Property Value

CommonFunctions

SqlServer

Surface of the text-JSON functions (SQL Server and MySQL/MariaDB), the SQL Server-only choose conditional function (the portable iif is on CommonFunctions) and the SQL Server string_split/openjson table functions. Every member requires SupportsTextJson, SupportsChoose or SupportsTableFunction(string); other providers reject it with a clear message.

public static SqlServerFunctions SqlServer { get; }

Property Value

SqlServerFunctions

Sqlite

Surface of the SQLite-only functions (the core scalars, the JSON1 functions/operators/aggregates, the date helpers and the math-extension functions). Every member is gated by SqliteFunctions; other providers reject it with a clear message.

public static SqliteFunctions Sqlite { get; }

Property Value

SqliteFunctions

Methods

Column<T>(object, string)

References a column of an entity source by its database name with an explicit CLR type, for entities that do not declare a property for the column (for example a wide ClickHouse table). The value is materialized as T.

public static T Column<T>(object entity, string columnName)

Parameters

entity object

The entity source the column belongs to (a query lambda parameter).

columnName string

The raw database column name. It is not SQL text: it is always safely quoted by the provider, regardless of the command's QuoteIdentifiers option. A dot is a literal name character (not a schema/alias qualifier), SQL-looking punctuation stays inside the one identifier, and the name is never stripped of brackets. Manual pre-quoting is not supported, so Column(t, "[1]") is the literal three-character name [1] (rendered [[1]]] on SQL Server); to reference the column named 1 write Column(t, "1").

Returns

T

Type Parameters

T

The CLR type of the column value.

Remarks

Only valid inside a query expression. The in-memory provider has no column-name concept and rejects the query.

Parameter<T>(int)

References the idx-th positional parameter of the command (for example @p0). Only valid inside a query expression.

public static T Parameter<T>(int idx)

Parameters

idx int

The zero-based parameter index.

Returns

T

The parameter value, materialized as T.

Type Parameters

T

The CLR type of the parameter value.