Table of Contents

API reference

A curated index of nextorm's public types, grouped by namespace, each linked to its generated API reference.

Prerequisites: Quickstart · Provider overview

Overview

This is a curated index; the reference generated from the XML doc comments on the source types is published in the API reference section of this site (see the top navigation). Each entry below gives the type, a one-line description and, through the type name itself, a link to its generated API reference page.

Types are listed under their defining namespace. All of the query API is in NextORM.Core; each provider package adds a context, a dialect and a DataContextBuilder extension class in its own namespace.

Namespace NextORM.Core

Context and roles

Type Description
IDataContext Composite facade over the context roles; the entry point consumers normally depend on.
IQueryExecutor Executes a prepared command and materialises its result (terminals).
IQueryMaterializer Narrowest contract for planning + row reading, without terminals.
IQueryPlanner Builds/resets execution plans and resolves From sources.
IRowReaderFactory Creates row readers/enumerators over a prepared command.
IQueryCache Holds cached plans and the shared Any plan.
DataContextCache Process-wide caches (metadata, select lists, compiled delegates, row mappers): Clear empties them and invalidates the plan cache, and CacheSlidingExpiration enables lazy time-based eviction. See Query reuse.
IContextEnvironment Ambient state: loggers, mapping mode, property bag.
IConnectionManager Owns the connection lifecycle (not part of IDataContext; the in-memory provider does not implement it).
ITransactionManager Owns the context's transaction: BeginTransaction()/BeginTransactionAsync() (plus IsolationLevel overloads), TryBeginTransaction(out DbTransaction?)/TryBeginTransactionAsync(ct) (start only when none is active, without throwing when one already is), UseTransaction(DbTransaction?) to enlist an externally owned one (EF Core/Dapper/ADO.NET), CurrentTransaction, and savepoints on the active or enlisted transaction — CreateSavepoint/RollbackToSavepoint/ReleaseSavepoint plus their *Async twins (1–32 ASCII identifier names; SQL Server's release is a no-op). Not part of IDataContext (the in-memory provider does not implement it); ClickHouse rejects it. See Transactions.
InMemoryDataContext Built-in in-memory IDataContext over CLR collections.
IRawCommandExecutor Role that executes a raw parameterised command (ExecuteRaw/ExecuteRawAsync) or a stored procedure by name (ExecuteProcedure/ExecuteProcedureAsync) and returns a ProcedureResult. The default implementations throw NotSupportedException (the in-memory provider, and SQLite/ClickHouse for procedures). See Raw SQL.
ProcedureParameter Name, value and ADO.NET options (Direction, DbType, Size, TypeName) of a raw-command/stored-procedure parameter. TypeName is SQL Server only; the Table<T> factories build a table-valued parameter.
TableParameterValue Base carrier of a table-valued parameter's row type and rows, produced by ProcedureParameter.Table<T> and translated per provider (native on SQL Server; typed array/JSON emulation on PostgreSQL, MySQL/MariaDB and SQLite; a bound Array(T)/Array(Tuple(...)) expanded with arrayJoin(@p) on ClickHouse; NotSupportedException on the in-memory provider). See Raw SQL.
TableParameterColumn One resolved column of a TableParameterValue (returned by GetColumns): the provider Name, the bound ClrType (value-converter/duration/enum aware), the declared DecimalPrecision/DecimalScale (or null) and GetValue(row). See Raw SQL.
ProcedureOutputParameter Snapshot of one output/input-output parameter after a raw command or procedure ran.
ProcedureResult Disposable result of ExecuteRaw/ExecuteProcedure: Read<T>()/ReadAsync<T>() over result sets in order, positional and one-shot; the result object is enumerable — foreach/await foreach yields a ResultSet cursor per column-bearing set so each set reads its own T; plus OutputParameters and ReturnValue (first access closes the reader). See Raw SQL.
ResultSet Read-only cursor over one column-bearing result set yielded by enumerating ProcedureResult or BatchResult: Index (0-based among column-bearing sets only), FieldCount, ColumnNames (snapshot, valid after the outer cursor advances) and the per-set Read<T>()/ReadAsync<T>(CancellationToken = default). Valid only while its set is current; a stale or uninitialized cursor, a second read of the same set, or reading after the owning result is disposed throws. See Raw SQL.

Query builders

Type Description
EntityBuilder<TEntity> Fluent, immutable query builder for a mapped entity type. Per-query source overrides: WithTableName, WithSchema, WithDatabase, WithServer and WithTableExpression (see Per-query source overrides). As<TResult> projects a joined or plain source into a named type exposed as a derived table in FROM, restarting the join arity so composition continues from the named members. The row-selection helpers SelectWhereMax / SelectWhereMin keep the row(s) with the extreme value, globally or per group (ExtremeRowTies), and the projection overloads return a typed command; One is lowered to a window-function derived table (rendered natively on PostgreSQL and ClickHouse for the forms their renderer accepts), while All is lowered to an aggregate form joined back to the source; a floating-point value key on ClickHouse keeps the ranking window instead, because that server's max()/min() and its ORDER BY disagree about NaN. The in-memory provider evaluates the same contract over its own enumerator. Attach an external query component with WithComponent; a component whose slot is already present replaces it in place. See Keeping the extreme row and Extending query construction with query components.
IQueryComponent, IQueryComponentDescriptor, IQueryComponentPrepareContext, IQueryComponentBuildContext, QueryComponentContext, QueryComponentContribution, IQueryComponentShape Public contract for extending query construction from an external assembly. IQueryComponent declares the stable Slot, the Contribution kind (AdditivePredicate or ExclusiveRowSource), Prepare(IQueryComponentPrepareContext) — validation returning an immutable IQueryComponentDescriptor with the slot, concrete component type, contribution, semantic Discriminator, StructuralHash and StructurallyEquals — and BuildQuery(IQueryComponentBuildContext), which assembles the structural contribution from engine primitives on a cache miss only. QueryComponentContext is the engine's prepare/build context (Command, ExpressionComparer). Descriptors participate in the plan key (hash and equality), so a warm cache hit reuses the cached plan without rebuilding. Which side implements and which side calls each member, and the exact call order, are tabulated in Who implements what, and who calls it. See Extending query construction with query components.
Parameterless materialization overloads EntityBuilderExtensions.ToList<TEntity>(this EntityBuilder<TEntity>) / ToArray<TEntity>(this EntityBuilder<TEntity>) and QueryCommand<TResult>.ToList() / ToArray() — additive parameterless twins of the params ReadOnlySpan<object?> terminals, each forwarding to its twin with an empty span. They exist so a collection-valued projection slot (AsEntityBuilder<T>() … ToList()) is expressible in an expression tree, where the span/expanded-params twins cannot be referenced (CS8640/CS9226).
Ordering overload families EntityBuilder<TEntity> and QueryCommand<TResult> both expose OrderBy(key), OrderBy(key, OrderDirection), OrderBy(key, NullsPosition), OrderBy(key, OrderDirection, NullsPosition), OrderByDescending(key), OrderByDescending(key, NullsPosition) and the secondary-key family ThenBy(key), ThenBy(key, OrderDirection), ThenBy(key, NullsPosition), ThenBy(key, OrderDirection, NullsPosition), ThenByDescending(key), ThenByDescending(key, NullsPosition), where key is either Expression<Func<TEntity, object?>>/Expression<Func<TResult, object?>> or the 1-based int output column index (the index resolves to the real sort key before an emulated placement is applied). Each key carries its own direction and NullsPosition; ThenBy appends rather than replaces. See Sorting and paging.
TvfEntityBuilder<T> Context-independent runtime descriptor of a table-valued function, returned by an ordinary static factory (public static TvfEntityBuilder<Row> MyTvf(int id) => new("my_tvf", "dbo");). The metadata is immutable and constructor-only (Name, Schema, WithClause, CallClause, VerbatimArguments, ResultSchema); the scalar factory parameters declare only the SQL argument positions and the metadata must not depend on their values. Consumed as a lambda source by From, the join extensions and CrossApply/OuterApply; composing it without a context is allowed, executing an unbound chain is not. See Table-valued functions.
TvfJoinSourceExtensions Lambda-source Join/LeftJoin/RightJoin/FullJoin/CrossJoin extension overloads (receiver arities 2–8, with and without JoinOptions) that take a runtime TVF factory call as Expression<Func<EntityBuilder<T>>>, keeping its argument expressions for the shared lowering. A captured descriptor is rejected with NotSupportedException (lost provenance). Extension methods on purpose, so an existing entity/CTE/derived-query call keeps binding to the instance overloads. See Table-valued functions.
CreateQueryBuilder<T> and the nine sibling forwarders Additive query-source entry points, one per From overload; the From / FromSql / runtime-factory From(() => ...) entry points are available alongside them. The ten forwarders are the nine CreateQueryBuilder overloads (entity metadata; metadata + FromOptions; string; string + FromOptions; QueryCommand<TResult>; QueryCommand<TResult> + FromOptions; TempTableSource<TResult>; EntityBuilder<TResult>; EntityBuilder<TResult> + FromOptions), plus CreateQueryBuilderFromSql(string, object?). Each delegates exactly once to its From* counterpart.
EntityBuilderExtensions Terminal operators of EntityBuilder<TEntity> (Any/ToList/First/Single/Last/Count/aggregates/To*/Prepare) as extension methods.
BindEntity<TEntity> Declares the entity type and output columns of a raw FromSql/From(string) source so its global query filters are applied best-effort: public static EntityBuilder<TEntity> BindEntity<TEntity>(this EntityBuilder<TableAlias> source, IReadOnlyCollection<string> availableColumns). A filter whose columns are all declared is injected; a filter with missing columns is skipped — no exception — and a RawSourceFilterSkipped warning is written once per skipped filter on the NextORM.QueryFilters logger category (level Warning, reason MissingColumns, carrying the physical mapped column names), on cache-miss preparation only. With an empty declared-column list, a filter with a proven zero-column dependency is applied and a column-dependent or undetermined filter is skipped with reason UndeterminedColumns. Binding is per source: each joined source uses its own binding, the main source's filters are re-rooted onto Item1 in a joined command, and SourceOrdinal is 0 for the main source and j + 1 for join index j, counting all joins. Must be the first operation after the source (a later call throws InvalidOperationException); another source shape, or TableAlias, throws NotSupportedException. The column list is unvalidated and the binding is not a security guarantee. See Filters on bound raw sources.
InsertBuilder<TEntity> Fluent INSERT ... VALUES/INSERT ... SELECT builder started with CreateInsertBuilder<TEntity>: Value/Values — plus the batch overloads Values(source, mapping) (an IEnumerable source inserts client-side values, an EntityBuilder<TSource> source renders a server-side INSERT ... SELECT), Values(scalar[]), Values(column, values), the selector-less scalar Value(value) and SqlDefault.Value for a column default —/Insert/Returning/ReturningIdentity/ReturningIdentity<TKey>()/ReturningKey/ToSql. See Data modification.
InsertReturningBuilder<TEntity,TResult> Row-returning terminal created with Returning/Returning: Single/SingleAsync return one row and ToList/ToListAsync return every row, materialised through the provider's RETURNING/OUTPUT. The same builder exposes SQL Server OutputInto/OutputIntoThenOutput (see the next row). See Returning the inserted rows.
OutputIntoBuilder SQL Server OUTPUT ... INTO terminal created with OutputInto (also on the update/delete returning builders): Execute/ExecuteAsync write the modified rows into an existing table and return the affected-row count, and ToSql renders the statement; there are no row terminals. OutputIntoThenOutput keeps the row terminals and also writes into the target. Gated by ISqlDialect.SupportsOutputInto. See Writing the modified rows into a table.
MergeBuilder<TEntity> Key-upsert / full-MERGE builder started with CreateMergeBuilder<TEntity>: Using(entity)/Using(IEnumerable)/Using(QueryCommand) selects the source (a query source is accepted by the full-MERGE form only), OnKeys() matches on the declared key, and Merge()/MergeAsync()/ToSql() are the terminals. The key-upsert branches are WhenMatchedUpdate()/WhenNotMatchedInsert(); the full-MERGE branches are WhenMatched()/WhenNotMatched()/WhenNotMatchedBySource(), each finished with ThenUpdate/ThenInsert/ThenDelete (MergeMatchedBuilder<TEntity>/MergeNotMatchedBuilder<TEntity>/MergeNotMatchedBySourceBuilder<TEntity>), and Returning()/Returning(projection) switch to a row-returning terminal. WhenMatchedUpdate(assignments)/ThenUpdate(assignments) take a two-parameter (target, source) or three-parameter (target, source, excluded) lambda (the third being the provider's native proposed row where one exists), and WhenNotMatchedInsert(assignments)/ThenInsert(assignments) take a single-parameter source lambda; each argument is an anonymous or assignable typed initializer whose right-hand sides are translated expressions. A one-parameter ThenInsert accepts an initializer only. Full MERGE is native on SQL Server and PostgreSQL 15+; the other providers reject it. Under an active global query filter the full MERGE isolates the target (predicate in ON and every WHEN NOT MATCHED BY SOURCE arm), while an unfilterable key upsert (ON CONFLICT / ON DUPLICATE KEY / in-memory) throws NotSupportedException; IgnoreFilters restores the native behavior (see Write-target isolation). See Upsert (key merge) and Full MERGE.
MergeReturningBuilder<TEntity,TResult> Row-returning terminal created with Returning/Returning: Single()/SingleAsync() return one merged row and ToList()/ToListAsync() every merged row, materialised through the provider's OUTPUT/RETURNING. Available on both the full-MERGE branch form and the key-upsert form (PostgreSQL/SQLite ON CONFLICT ... RETURNING, SQL Server MERGE ... OUTPUT); MySQL/MariaDB reject it. See Returning the merged rows.
DeleteBuilder<TEntity> DELETE builder started with CreateDeleteBuilder<TEntity>: Where(predicate) filters, All() marks an explicit full-table delete, Returning()/Returning(projection) switch to a row-returning terminal, and Delete()/DeleteAsync()/ToSql() are the terminals. The key form is the context extension Delete<TEntity>(entity). See Delete.
Delete<T1,T2>(JoinedEntityBuilder<T1,T2>) Multi-table DELETE terminal on a joined query (arities 2–8): the first table is the target and the removed rows are those matching an INNER join. Native on PostgreSQL (USING), SQL Server, MySQL and MariaDB (DELETE <alias> FROM ... JOIN); SQLite, ClickHouse and the in-memory provider throw. Complements DeleteAsync/ToSql. See Delete based on a join.
DeleteJoinBuilder<TProjection> Row-returning starter for a multi-table DELETE, created with CreateDeleteJoinBuilder<T1, T2> on a joined query (arities 2–8): Returning()/Returning(projection) switch to a row-returning terminal (Returning() — equivalent to Returning(p => p) — returns the whole joined projection; the explicit projection form is unchanged). The first table is the delete target; PostgreSQL only, INNER joins. See Delete based on a join.
UpdateBuilder<TEntity> UPDATE builder started with CreateUpdateBuilder<TEntity>: Set(column, value), Set(column, expression) and Set(entity) build the SET list, Where(predicate) filters (optional — omitting it updates every row), Returning()/Returning(projection) switch to a row-returning terminal, and Update()/UpdateAsync()/ToSql() are the terminals. The key form is the context extension Update<TEntity>(entity). See Update.
UpdateReturningBuilder<TEntity,TResult> Row-returning terminal created with Returning/Returning: Single()/SingleAsync() return one updated row and ToList()/ToListAsync() every updated row, materialised through the provider's RETURNING/OUTPUT. See Returning the updated rows.
UpdateJoinBuilder<TProjection> Multi-table UPDATE ... FROM/join builder created with CreateUpdateJoinBuilder<T1, T2> on a joined query: Set(column, value)/Set(column, expression) write a column of the first table (the value may read any joined table), Where(predicate) filters (optional), Returning()/Returning(projection) switches to a row-returning terminal (Returning() — equivalent to Returning(p => p) — returns the whole joined projection; the explicit projection form is unchanged), and Update()/UpdateAsync()/ToSql() are the terminals. Only INNER joins, and row-returning is PostgreSQL-only for arities 2–8. See Updating from a join.
UpdateJoinReturningBuilder<TProjection,TResult> Row-returning terminal created with Returning()/Returning(projection): Single()/SingleAsync() return one updated row and ToList()/ToListAsync() every updated row, materialised through PostgreSQL's UPDATE ... FROM ... RETURNING. The other providers reject it. The same builder is accepted as a data-modifying CTE body by With(name, update). See Updating from a join.
DeleteReturningBuilder<TEntity,TResult> Row-returning terminal created with Returning/Returning: Single()/SingleAsync() return one removed row and ToList()/ToListAsync() every removed row, materialised through the provider's RETURNING/OUTPUT. See Returning the removed rows.
DeleteJoinReturningBuilder<TProjection,TResult> Row-returning terminal for a multi-table DELETE, created with DeleteJoinBuilder<TProjection>.Returning()/Returning(projection) (the parameterless form is equivalent to Returning(p => p) and returns the whole joined projection): Single()/SingleAsync() return one removed row and ToList()/ToListAsync() every removed row, materialised through PostgreSQL's DELETE ... USING ... RETURNING. The other providers reject it. The same builder is accepted as a data-modifying CTE body by With(name, delete). See Delete based on a join.
TruncateBuilder<TEntity> TRUNCATE TABLE terminal started with CreateTruncateBuilder<TEntity>: Execute()/ExecuteAsync()/ToSql() render and run the provider's native TRUNCATE. See Truncating a table.
BulkInsertBuilder<TEntity> Fluent bulk-insert builder started with CreateBulkInsertBuilder<TEntity>: Values(IEnumerable)/Values(IAsyncEnumerable) supply the set, BulkInsert()/BulkInsertAsync(ct)/ToSql() are the terminals, and ReturningKey<TKey>()/Returning(projection) switch to a row-returning terminal. Writes through the provider's native bulk API (PostgreSQL COPY, SQL Server SqlBulkCopy, MySQL/MariaDB MySqlBulkCopy, ClickHouse InsertBinaryAsync) or a chunked INSERT ... VALUES, chosen by BulkInsertMode, and shaped by BulkInsertOptions. See Bulk insert.
BulkInsertOptions / BulkInsertOptionsBuilder Write options for BulkInsertBuilder<TEntity>: the Mode (Auto/Native/Portable) and TargetKind (Regular/LocalTemporary), batch limits (MaxBatchSize/MaxParameters/MaxSqlLength), destination retargeting (TableName/TableSchema) and the independent SchemaName/DatabaseName parts (ServerName is refused), KeepIdentity/IgnoreDuplicates, the bulk-copy flags CheckConstraints/TableLock/KeepNulls/FireTriggers, a whole-invocation Timeout as a TimeSpan, progress, and the provider groups SqlServerBulkInsertOptions (UseInternalTransaction) and ClickHouseBulkInsertOptions (MaxDegreeOfParallelism/UseSession). Every option defaults to preserving the current behavior, and an option the resolved path cannot honour is refused by name. See Bulk insert.
BulkCopyFlags The resolved SQL Server bulk-copy flags (CheckConstraints/TableLock/KeepNulls/FireTriggers) passed to the protected native bulk hooks DataContext.BulkInsertRows/BulkInsertRowsAsync; a non-empty set on a path that cannot express it throws NotSupportedException instead of being ignored.
TempTableExtensions Materialises a query into a table: ToTable(name, options)/ToTempTable(name, options) on a query builder or a built QueryCommand<TResult>, their async twins (a name is required), and ToTableSql/ToTempTableSql for diagnostics, configured with CreateTableOptions (IfNotExists, DropExisting, Columns, WithData, OnCommit — TempTableOnCommit) or a CreateTableOptionsBuilder callback. ToTable works on PostgreSQL, SQLite, MySQL, MariaDB (CREATE TABLE ... AS SELECT), SQL Server (SELECT ... INTO) and ClickHouse (ENGINE = MergeTree); the temporary ToTempTable is on PostgreSQL/SQLite/MySQL/MariaDB only. AsTempTable returns a lazy TempTableSource<TResult> that materialises on every read through From (one DROP + CREATE TEMPORARY TABLE + read batch), and ToBatchSql renders that batch. See Materializing a query.
BatchExtensions / BatchBuilder / BatchQuery<TResult> / BatchResult Executes several statements as one batch (one round trip, one server session): ctx.CreateBatchBuilder() → side-effecting steps — CreateTempTable/CreateTable (materialisations) and Insert/Update/Delete/Truncate (DML, taking InsertBuilder/UpdateBuilder/DeleteBuilder/TruncateBuilder) — then the result-bearing queries. For a single result, Query<TResult> returns the BatchQuery<TResult> terminal (ToList/ToListAsync/ToAsyncEnumerable/ToSql). For several results, AddQuery<TResult> chains any number and Execute()/ExecuteAsync(CancellationToken = default) run the batch once and return an eager, non-disposable BatchResult — enumerable (foreach/await foreach over ResultSet cursors) or ResultSetCount + Read<TResult>() (sets read sequentially, each once, type-checked) — while BatchBuilder.ToSql() renders the whole batch without executing it (it requires at least one result step). Gated by ISqlDialect.SupportsBatch; ClickHouse and the in-memory context throw. See Executing statements in one batch.
EntityBuilder Fluent builder for an alias/table source that has no entity type (TableAlias mode).
JoinedEntityBuilder<T1,T2> … JoinedEntityBuilder<T1..T8> Accumulated join builders; arity 2 through 8.
Alias / AliasProjection_<aliases> / AliasJoin_<aliases> (generated) The named-join surface emitted by the nextorm analyzer: .Join<Person>(people, (a, b) => a.Id == b.Id, Alias.Buyer) names the joined slot and the projection then exposes the typed p.Buyer member, with no pre-declared projection. The generated public types land in NextORM.Generated.<assembly name> and carry JoinSlot (the first alias is slot 2); the positional ItemN members remain available. SQL providers only (the in-memory provider throws NotSupportedException), arity ≤ 8, and all seven join operators accept the marker. See Named join aliases.
EntityMetadataBuilder<T> Fluent entity-metadata configuration used by IDataContext.From<T>(...); Property returns an EntityPropertyBuilder<T> with HasColumnName/Key/Identity/Computed/Duration/DecimalPrecision/Collation/HasConversion/JsonColumn/DynamicColumnsStore.
IPropertyMetadata Read-only mapping metadata for one property (PropertyInfo, ColumnName, IsKey, IsIdentity, IsComputed, DurationUnit/DurationPrecision, DecimalPrecision/DecimalScale, Collation, Converter, IsDynamicColumnsStore); the store itself is reached through IEntityMetadata.DynamicColumnsStore.
INamingConvention Translates auto-derived table/column names (see DataContextBuilder.UseNamingConvention); built-in SnakeCaseNamingConvention maps SimpleEntity to simple_entity and FirstName to first_name.
Projection<T1,T2> … Projection<T1..T8> Result shape of a joined query; exposes Item1…``
IProjection / IExtendableProjection Markers for accumulated join projections (arity 8 is not extendable).
CteQuery Fluent scope collecting WITH declarations.
CteDefinition One CTE: name, defining query, recursive flag and optional max recursion.
MutationCteQuery<TResult> Typed scope for a PostgreSQL data-modifying CTE (WITH n AS (INSERT|UPDATE|DELETE ... RETURNING ...), created with the With(name, insert)/With(name, update)/With(name, delete) overloads — for example With — each accepting a row-returning mutation and requiring a RETURNING projection, single-table or join/multi-table): From reads the returned rows typed, FromTable reads a plain read CTE, and With/WithRecursive mix in read CTEs. See data-modifying CTE.
TableAlias / TableColumn Alias-mode column accessors (GetInt32, GetString, …) and typed column wrapper (AsInt, AsString, …).
Paging Limit / Offset / HasWithTies value used by every query builder.

Commands, plans and functions

Type Description
QueryCommand Non-generic query command holding the plan/state shared by all results; the attached query components and their prepared descriptors are exposed as Components and PreparedComponents.
QueryCommand<TResult> Typed query command with terminals (ToList, First, Union, Distinct, Hint, WithTag, ForJson, WithForJson, ForXml, WithForXml, WithTableHint, WithJoinTableHint, WithIndex, WithJoinHint, WithSubQueryHint, WithTablesInScopeHint, WithKeywordCase, WithCommandTimeout, Prepare, …).
JsonStreamMode / JsonStreamOptions Container/shape options for the JSON streaming terminals WriteJson/WriteJson/WriteJsonAsync/WriteJsonAsync: Mode (Array default / NdJson), Root (an array wrapper object), IgnoreNull, WriteIndented (array only) and PropertyNamingPolicy. The terminals stream the query's Select projection to a caller-owned Stream with O(buffer) memory and no per-row TResult, never close the destination, fail fast on a shape outside the scalar whitelist (enums stream as their numeric value, or as a string for a stock JsonStringEnumConverter/JsonStringEnumConverter<TEnum> attribute; any other JSON converter attribute, on an enum or a non-enum scalar, is rejected before output), and are SQL-provider only (in-memory throws NotSupportedException). Each terminal also has a positional-SQL-parameter overload — WriteJson(Stream, JsonStreamOptions, CancellationToken, params ReadOnlySpan<object?>) and WriteJsonAsync(Stream, JsonStreamOptions, CancellationToken, params object?[]) on both QueryCommand<TResult> and EntityBuilder<TEntity> — where options and the token are required (no defaults) and the trailing values bind in placeholder order (null → DBNull, an empty set binds nothing). Preflight validation throws NotSupportedException under the stable JSON streaming validation [<token>]: <context>. convention (mode-options, projection, names, unsupported-column, reader-binding, in-memory, unsupported-execution-form), and an incompatible reader schema is rejected before any output. On SQL Server an eligible flat projection is served natively through a trailing FOR JSON PATH (flat object, simple aliases, string/bool/short/int/long incl. nullable, Array mode, no root/indentation/naming policy); the output stays logically equivalent (SQL Server escaping may differ) and every other shape/provider uses the managed writer, with no API/signature change. Any failure or cancellation during the copy is fail-stop: the original error (or OperationCanceledException) propagates, already-written bytes stay in place with no rollback or recovery tail, the destination is never closed and the library never adds a Stream.Flush; pre-output validation, the in-memory refusal and the lazy temp-table refusal leave the destination untouched — the policy is route-independent. See Streaming data to a Stream.
QueryDefinition Immutable query shape (projection/entity source, condition, joins, paging, sorting, grouping, logger) taken by the command constructors and CreateCommand.
QueryCommandExtensions LOB terminals. The single-column ToStream/ToTextReader and their async forms open the reader with CommandBehavior.SequentialAccess and return a Stream/TextReader that owns the command until disposed; a projection other than exactly one byte[]/string column throws InvalidOperationException. The multi-column ToDataReader and its async/cancellation/token/parameter overloads return a caller-owned DbDataReader over the sequential-access command with no field-count guard, so the caller reads every column and row in ascending ordinal order and disposes the reader. A SQL dialect that does not opt in throws NotSupportedException. ToDataReader routes by dialect: a non-locator dialect with sequential access (PostgreSQL, SQL Server) returns the sequential-access reader, while a locator dialect (SQLite) is served by a buffered, locator-free reader (no rowid, FieldCount equals the projection, no chunked LOB). The in-memory provider has no dialect and no DbDataReader: its scalar terminals materialise the single projected value and return a caller-owned MemoryStream/StringReader (an empty result or a NULL first value yields Stream.Null/TextReader.Null), while ToDataReader stays NotSupportedException. The gate is SupportsSequentialAccess, a default interface member returning false that PostgreSQL, SQL Server and SQLite override. On the scalar streaming terminals in SQLite the query source must additionally expose rowid to keep the payload streaming: the dialect declares its trailing locator column through LobLocatorColumn (string?, default null; SQLite "rowid"), appended after the payload so the payload stays at ordinal 0; a view/WITHOUT ROWID source fails with the raw SqliteException: no such column: rowid. The multi-column ToDataReader uses the locator-free buffered preparation instead, so it is not subject to that restriction. See Streaming large objects. The CSV terminals WriteCsv/WriteCsvAsync stream the projection to a caller-owned Stream (UTF-8 without a BOM, RFC 4180 escaping, CRLF terminators), reading rows straight from the provider reader without materialising the result set or constructing TResult per row; the destination stream is never closed, the in-memory provider throws NotSupportedException, and a projection that has no single scalar CSV form or whose storage type is unknown/cannot be converted — a nested entity/collection, a non-byte[] array, a tuple, a dictionary, an arbitrary object, or an object-converter/GetValue column — is rejected before any row is written, while every supported column, including SQL Server numerics, is read without boxing through the provider's storage-typed getter and a typed conversion (no GetValue). A direct stored byte[] column is written in bounded Base64 chunks when the provider has confirmed sequential access (PostgreSQL, SQL Server, SQLite); on MySQL/MariaDB/ClickHouse and for every non-eligible binary case it is read whole-field. See Streaming data to a Stream.
CsvStreamOptions Dialect of the CSV written by WriteCsv/WriteCsvAsync: IncludeHeader (default true) emits the projection-derived header row, Delimiter (default ,) sets the field separator, NullMarker (default \N) is the literal written for a SQL NULL (empty string stays an empty field; data equal to the marker is force-quoted; the marker is validated), ExcelMode (default false) prefixes ' to a value starting with =/+/-/@ after the transform and before escaping, and ValueTransform (default null) replaces the default non-NULL formatting (a null return writes the marker; the default path is box-free). The encoding (UTF-8 without a BOM), RFC 4180 escaping, CRLF terminators and invariant-culture value formats are fixed. See Streaming data to a Stream.
PrepareFromSqlMode Flags for PrepareFromSql: None (buffered/scalar), Streaming, ``
PreparedCommandOptions Non-generic setup of DbPreparedQueryCommand<TResult> (single row, raw SQL, no params, parameter refresh, sequential-access streaming).
IPreparedQueryCommand<TResult> Prepared command; its default members execute it against a supplied IDataContext.
SqlFunctions Static entry point: Sql, Postgres, SqlServer, ClickHouse, Sqlite, Parameter and the by-name Column<T> (whose string is a raw name, always safely quoted independently of the QuoteIdentifiers option; a dot is a literal character and manual pre-quoting is not supported).
CommonFunctions Cross-provider SQL function surface: exists, like, collate (per-expression COLLATE, gated by SupportsCollation), @in, any/all (subquery), the conditional iif (Iif/IIifRenderer.Render), aggregates (including filtered aggregates, string_agg and the arbitrary-value any_agg on MySQL/ClickHouse), window functions (including percent_rank/cume_dist and nth_value, the latter gated by SupportsNthValue, plus the window percentiles percentile_cont/percentile_disc on SQL Server/MariaDB), nullif/greatest/least/date_trunc/date_add/date_diff/date_diff_big/date_from_parts/end_of_month/extract/date_part, session/information functions (current_user/session_user/current_schema/current_database/version), the UUID generators (gen_random_uuid/uuidv7), the cross-provider scalar string/number functions left/right/lpad/rpad/repeat/reverse/space/concat_ws/translate/ascii/@char (gated per name by IScalarFunctions), and full-text predicates (contains/freetext).
Postgres PostgreSQL-only surface: arrays (any/all, cardinality, array_*, array_shuffle/array_sample, string_to_array), native JSON/JSONB, the extended scalar library (asin, split_part, lpad, regexp_*, to_char, setseed, pg_typeof, …), the crypto hashes md5/digest (pgcrypto)/sha256, the PostgreSQL-only aggregates (bool_*, bit_*, regr_*, percentile_*, mode, array_agg), the set-returning table functions (generate_series/unnest, regexp_matches/regexp_split_to_table, jsonb_array_elements(_text), jsonb_each(_text), jsonb_object_keys, jsonb_path_query, ts_stat, and the record functions jsonb_to_record/jsonb_to_recordset whose result schema comes from the caller's TRow under SupportsResultSchema(TableFunctionSchema)), and the native text-search surface (to_tsvector/to_tsquery/ts_rank/ts_rank_cd/ts_headline/@@), the native range surface (overlaps, range_contains/range_contained_by, range_union/range_intersection/range_difference, the positional/adjacency operators, lower/upper/isempty/lower_inc/upper_inc/lower_inf/upper_inf, the int4range/int8range/numrange/tsrange/tstzrange/daterange constructors and empty_range<T>()).
SqlServer Text-JSON surface (json_value/json_query/json_modify/isjson) for SQL Server and MySQL/MariaDB, the SQL Server-only conditional function choose (SupportsChoose), the postfix XML data-type methods xml_value/xml_query/xml_exist and the xml_nodes rowset (XmlFunctions; row shape IXmlNodesRow), plus the SQL Server string_split/openjson table functions and the full-text ranking table functions containstable/freetexttable (row shape IKeyRankRow<TKey>). Also the T-SQL-only scalar library patindex/quotename/soundex/difference/string_escape/unicode/nchar/format, the trigonometric functions (acos/asin/atan/atn2/square), the date functions datename/date_bucket, the binary/system functions hashbytes/newsequentialid and the SQL/JSON constructors, aggregates and predicates (json_array/json_object/json_arrayagg/json_objectagg/json_contains/json_path_exists), each gated per name by ISqlServerFunctions (ISqlDialect.SqlServerFunctions).
Sqlite SQLite-only surface (ISqliteFunctions): core scalars (printf/format, hex/unhex, random/randomblob, quote, @typeof, glob, unicode/@char, soundex, octet_length, ifnull/@if), the JSON1 functions/operators/aggregates (json_extract, json_get/json_get_text, json/jsonb, json_set/json_insert/json_replace/json_array_insert, json_object/json_patch/json_pretty/json_quote/json_remove/json_type/json_valid, json_group_array/json_group_object), the json_each/json_tree table functions (row shapes IJsonEachRow/IJsonTreeRow), the date helpers (timediff/unixepoch/julianday) and the math-extension functions (acos/asin/atan/atan2, the hyperbolics, log2/log10, mod).
ClickHouse ClickHouse-only surface: the arg_min/arg_max, uniq/uniq_exact/uniq_combined/uniq_hll12, the parameterised quantile/quantile_exact/quantile_timing/quantiles/median aggregates, the most-frequent top_k/top_k_weighted aggregates, the row-picking any_last aggregate, the sequence/funnel window_funnel/sequence_match/retention aggregates, the frame-respecting lag_in_frame/lead_in_frame window functions, the multi-branch multi_if conditional (built with when/otherwise), the string-JSON json_extract_string/json_extract_int/json_extract_float/json_extract_bool/json_extract_raw/json_has/json_length/json_type family plus visit_param_extract_string/_int/_float/_bool/_raw the JSONPath json_value/json_query/json_exists, the array-returning json_extract_keys/json_extract_array_raw (string[]) and json_extract_keys_and_values<T> (Tuple<string, T>[]), the dictionary functions dict_get/dict_get_or_default/dict_has/dict_get_hierarchy/dict_get_children/dict_is_in, the array-returning aggregates group_array/group_uniq_array (groupArray/groupUniqArray), the distributed global_in predicate, the numbers/numbers_mt and zeros/zeros_mt table functions, the server/cluster table functions url/s3/file/remote/remote_secure/cluster/cluster_all_replicas (generic TRow row interface), the values<TRow>(tuples) table function whose structure is rendered from TRow (SupportsResultSchema(TableFunctionSchema)), and the array functions over Array(T) columns/expressions (array_join, length, has, index_of, has_any, has_all, starts_with, ends_with, has_substr, array_string_concat, split_by_char, array_sort, array_reverse, array_distinct, range, array_enumerate, array_cum_sum, array_slice, array_push_back), and the higher-order (lambda) array functions (array_map, array_filter, array_exists, array_all, array_count, array_first/array_first_index, array_last/array_last_index). the ClickHouse-only math functions log2/cbrt/exp2/exp10 (each a double and a double? overload, rendered log2(x)/cbrt(x)/exp2(x)/exp10(x), results Float64/Nullable(Float64)).. The tuple surface maps the CLR Tuple.Create/System.Tuple<...>.ItemN to tuple(...)/tupleElement(t, n) under SupportsTupleFunctions.
WindowFunction<T> Unfinished window call; complete it with Over(...). Over(string) references a named window declared on the query.
WindowOrder An ordered window key plus OrderDirection.
WindowDefinition, NamedWindowOrderKey A named window (WINDOW w AS (...)) declared with EntityBuilder.Window and its ordered keys.
WindowFrame, WindowFrameBound, WindowFrameType, WindowFrameBoundKind, WindowFrameExclusion ROWS/RANGE/GROUPS frame specification, its boundaries and the EXCLUDE variants.
PivotAggregate, PivotValue, UnpivotColumn, PivotExpression The native SQL Server PIVOT/UNPIVOT source construct: EntityBuilder.Pivot/Unpivot reshape a plain table or a derived query into named columns (Pivot). The pivot value, source-column and role strings are raw names (a pivot value is a data value), each emitted as one safely quoted identifier regardless of the QuoteIdentifiers option.
IIifRenderer, ISessionInfoFunctions, IUuidGenerators, ILimitByRenderer Dialect capability objects exposed by ISqlDialect (Iif, SessionInfoFunctions, UuidGenerators, LimitBy). The object's presence is the capability, so support and rendering come from a single fact and can never diverge.
IScalarFunctions, ISqlServerFunctions, IXmlFunctions, ISequenceAggregateRenderer, IUniqAggregateRenderer, IQuantileAggregateRenderer, ITopKAggregateRenderer, IMultiIfRenderer, IDistinctOnRenderer, ITableSampleMethods, IPivotRenderer, IArrayJoinRenderer, IDateConversionRenderer, IStringSplitRenderer, ILockRenderer The remaining dialect capability objects exposed by ISqlDialect (ScalarFunctions, SqlServerFunctions, XmlFunctions, SequenceAggregates, UniqAggregates, QuantileAggregates, TopKAggregates, MultiIf, DistinctOn, TableSample, Pivot, ArrayJoinClause, DateConversion, StringSplit, Lock). Each nullable object is the single source of the capability and its renderer, so the XML/sequence/uniq/quantile/topK/multiIf/distinct-on/tablesample/PIVOT/unpivot/array-join/date-conversion/split/lock capabilities can never be "declared but unimplemented".
IExtremeRowRenderer Optional native renderer for the SelectWhereMax/SelectWhereMin row selection with ExtremeRowTies.One, exposed by ISqlDialect.ExtremeRowRenderer and SqlDialectBase.ExtremeRowRenderer (both default to null, which keeps the portable window-function lowering). CanRender(ExtremeRowDescription) is a side-effect-free decision taken before any SQL, alias or parameter is built; only a positive answer dispatches to Render(ExtremeRowRenderRequest), and Render has no late fallback. PostgreSQL and ClickHouse implement it; both dialects are deliberately non-sealed and keep their public constructors, Instance and the virtual ExtremeRowRenderer hook, so an external assembly can subclass them and install its own public IExtremeRowRenderer (returning null from the ExtremeRowRenderer override — or returning false from CanRender — keeps the portable lowering). The built-in renderers are internal. See Native extreme-row strategies.
ExtremeRowRenderColumn, ExtremeRowDescription, ExtremeRowRenderRequest Shape-only inputs of the native extreme-row contract: ExtremeRowRenderColumn (ClrType, IsNullable, IsDirectMappedColumn, UsesConverter), ExtremeRowDescription (IsMax, Keys, Groups, Payload; an empty Groups means the global form) handed to CanRender, and ExtremeRowRenderRequest (SourceSql, IsMax, PayloadAliases, KeyAliases, KeyColumns (the key shape facts positionally aligned with KeyAliases), GroupAliases, KeywordCase) handed to Render. Each DTO also exposes a public eager constructor so a non-friend assembly can build one and drive its own renderer; construction validates references and collection elements but performs no SQL/provider/security validation and never reads the payload, and the collections are borrowed (no copy or immutability). See Native extreme-row strategies.
NullsOrderingRenderer Public helper behind the NULL-placement rendering (namespace NextORM.Core): Validate(NullsPosition) returns the value or throws ArgumentOutOfRangeException for an undefined member, Render(keySql, direction, placement) is the portable CASE WHEN <key> IS NULL THEN … END ASC, <key> emulation (the key occurs twice, the rank prefix is always ascending), and RenderNative(keySql, direction, placement) appends NULLS FIRST/NULLS LAST to the key. ISqlDialect.SupportsNullsOrdering (default interface member, false) selects native versus emulation, and ISqlDialect.RenderOrderBy(expressionSql, direction, nullsPosition) renders one logical ordering item (default = emulation; SqlDialectBase declares both as virtual; SQLite, PostgreSQL and ClickHouse override them). See Sorting and paging.
DataContextExtensions Provider-independent helpers: From, From, the runtime table-valued-function source From, FromSql, CTE entry points (With / WithRecursive) and prepared-command terminals.

Mapping attributes

Type Description
SqlTableAttribute Maps a class or interface to a table name ([SqlTable("name")]).
SqlFunctionAttribute Maps a CLR method (or its declaring type) to a scalar database function; optional Name/Schema.
DurationAttribute Declares how a TimeSpan property is stored ([Duration(DurationUnit.Seconds)]), plus the native Precision; ignored where the provider has a native duration type. See Duration columns.
CollationAttribute Declares the database collation of a mapped property ([Collation("C")]); applied to the column in collation-sensitive query operations on providers with SupportsCollation. See Column collation.
DecimalPrecisionAttribute Declares the decimal precision/scale of a mapped property ([DecimalPrecision(12, 4)]), read as IPropertyMetadata.DecimalPrecision/DecimalScale; used where a provider needs the declared pair (SQL Server and ClickHouse table-valued parameter columns). The pair is validated against the type actually bound for the column, as precision 1..38 and 0 <= scale <= precision. A bound provider type of decimal is required: a non-decimal model mapped through a value converter to decimal is accepted, while a decimal model mapped to a non-decimal representation (a converter to string or a JsonColumn mapping) is rejected. An out-of-range pair throws ArgumentOutOfRangeException (parameter precision/scale); a non-decimal bound type, or a pair declaring only one of precision/scale, throws InvalidOperationException. The fluent equivalent is EntityPropertyBuilder<T>.DecimalPrecision. See Raw SQL.
DurationUnit Storage unit of a TimeSpan column on a provider without a native type: Ticks, Microseconds, Milliseconds, Seconds, Minutes, Hours, Days.
ValueConverterAttribute Declares the IPropertyValueConverter applied to a property ([ValueConverter(typeof(MyConverter))]). See Value converters.
JsonColumnAttribute Declares a property stored in a JSON column and serialized with System.Text.Json ([JsonColumn], optional Storage). See Value converters.
RangeColumnsAttribute Stores a Range<T> property as a pair of scalar columns ([RangeColumns("lower", "upper")], optional LowerInclusive/UpperInclusive) on a provider without a native range type; the range predicates and inspection functions are translated over the pair (SupportsRangeColumns). Range-returning operators stay PostgreSQL-only. See Range columns.
DynamicColumnsAttribute Marks a writable property assignable from Dictionary<string, object?> as the entity's dynamic-columns store: querying the entity as a whole renders select <mapped>, * (alias-qualified as select t1.<mapped>, `t1`.* on dialects where ISqlDialect RequiresQualifiedSelectStar is true, i.e. MySQL/MariaDB) and the store receives every unmapped column of the row (read side only). See Dynamic columns.
JoinSlotAttribute Marks a property of a generated alias projection with its 1-based entity slot (the base entity is slot 1, the first alias slot 2); the translator reads it to resolve the right SQL table alias when the joined CLR type occurs more than once. Emitted by the join-alias source generator; see Named join aliases.

| TableFunctionSchema | Where a table function's caller-declared result schema is rendered: None (default), LeadingArgument (ClickHouse values('a UInt8, b String', ...)) or AliasColumnList (PostgreSQL jsonb_to_record(json) AS x(a int, b text)). See Table-valued function result schemas. |

Value conversion

Type Description
IPropertyValueConverter Converts a mapped property between its CLR model type and the provider representation (ProviderType, ConvertToProvider, ConvertFromProvider, ConvertsNulls).
ValueConverter<TModel,TProvider> Strongly typed base class; override the typed conversions and the engine uses a cached invoker so value types are not boxed per row.
EnumToStringConverter<TEnum> Built-in converter that stores an enum as its name in a text column and parses it back (Enum.Parse<TEnum>); works for nullable enums too.
JsonColumnStorage Storage form of a JSON column: Auto (the provider's native JSON representation where it has one — PostgreSQL jsonb, ClickHouse JSON, SQL Server's json on a context declaring major version 17+ or an Azure/Fabric SQL database engine edition (5/8/12) — otherwise text), Native (requires that representation; refused with a dialect-named NotSupportedException elsewhere, e.g. MySQL/MariaDB/SQLite, and on a SQL Server context with no version and no version-17-equivalent edition) or Text.
JsonColumnOptions Fluent JSON column configuration (Storage, Options) for EntityPropertyBuilder<T>.JsonColumn.
JsonColumnConverter<TModel,TProvider> A System.Text.Json converter over a string (text column) or a JsonElement (native JSON column).

Supporting expression types

Type Description
OrderDirection Asc / ``
NullsPosition Explicit ORDER BY NULL placement: Default (0, no clause — the provider default), First (1, NULL values first whatever the direction) and Last (2, NULL values last whatever the direction). Independent of OrderDirection; an undefined value throws ArgumentOutOfRangeException. See NULL ordering and placement.
JoinType Inner, Left, Right, Full, Cross, FullCross, CrossApply, OuterApply, Semi, Anti, Paste.
ExtremeRowTies Which rows survive SelectWhereMax / SelectWhereMin: One (a single extreme row, the default) or All (every row tied on the extreme value). One is lowered as a window function (natively on PostgreSQL and ClickHouse for the forms their renderer accepts); All is lowered as an aggregate — GROUP BY plus a join-back per group, a scalar aggregate plus a join-back globally, component by component for a composite key — and never as a ranking window, except a floating-point value key on ClickHouse, which keeps the window because that server's aggregate and ordering disagree about NaN. See Keeping the extreme row.
JoinExpression A single join: condition, type and joined source.
JoinStrictness ClickHouse join modifier: Default, Any, All, Asof. Passed through a join's JoinOptions lambda with JoinOptions.WithStrictness; the ClickHouse GLOBAL variant uses JoinOptions.Global. The ClickHouse SEMI/ANTI/PASTE kinds are JoinType values with dedicated EntityBuilder.SemiJoin/AntiJoin/PasteJoin builders.
ArrayJoinKind ClickHouse ARRAY JOIN kind: Inner via EntityBuilder.ArrayJoin (drops empty arrays) or Left via EntityBuilder.LeftArrayJoin (keeps them); expands one row per array element.
ArrayJoinProjection<TEntity, TElement> Projection returned by EntityBuilder.ArrayJoinElement/EntityBuilder.LeftArrayJoinElement: Item1 is the original entity, Element the expanded array element. Requires a dialect with the ARRAY JOIN clause.
FromExpression / SelectExpression FROM source and projected column metadata.
Range<T> Provider-agnostic PostgreSQL range value (Lower/Upper, bound inclusivity, unbounded sides, IsEmpty, Empty); bound by the PostgreSQL provider as int4range/int8range/numrange/tsrange/tstzrange/daterange. See PostgreSQL range types.
TableSampleMethod Sampling algorithm for FromOptions.TableSample: System / Bernoulli (PostgreSQL only for Bernoulli).
FromOptions Per-query source options accepted by From<T>(o => ...) / From(table, o => ...): TableSample (percentage, PostgreSQL/SQL Server) and Sample (ratio + offset, ClickHouse).
LockMode Row-locking strength for EntityBuilder.ForUpdate/EntityBuilder.ForShare: Update / Share.
LockWaitMode How a row lock reacts to a row already held by another transaction, passed to EntityBuilder.ForUpdate/EntityBuilder.ForShare and to the source-level FromOptions.ForUpdate/JoinOptions.ForUpdate: Wait (the default) / NoWait / SkipLocked.
FromOptions.ForUpdate / FromOptions.ForShare Source-level row lock on the primary physical source, addressed by its SQL alias and carrying the same LockWaitMode. PostgreSQL/MySQL render FOR UPDATE OF <alias>/FOR SHARE OF <alias>; SQL Server places the hint on that source only; a provider whose ILockRenderer.SupportsSourceLocks is false (MariaDB) throws NotSupportedException.
JoinOptions.ForUpdate / JoinOptions.ForShare Source-level row lock on a joined physical source; same providers and limits as FromOptions.ForUpdate/ForShare.
TemporalKind / TemporalClause FOR SYSTEM_TIME clause for EntityBuilder.ForSystemTime: AsOf/Between/FromTo/ContainedIn/All, built with the static factory methods.
UnionType None, Distinct, All, Intersect, IntersectAll, Except, ExceptAll.

The ClickHouse-specific members in the table above (ArrayJoin/LeftArrayJoin/ArrayJoinElement/ LeftArrayJoinElement, SemiJoin/AntiJoin/PasteJoin, JoinOptions.Global, FromOptions.Sample) are extension methods in the NextORM.ClickHouse namespace, not the common builder API; add using NextORM.ClickHouse; to use them.

Interceptors

Type Description
IQueryInterceptor Observes the command execution lifecycle: CommandInitialized, CommandExecuting, CommandExecuted, CommandFailed. Raised by the context's execution axis; register with DataContextBuilder.AddInterceptor or DataContext.AddInterceptor. See Interceptors.
IConnectionInterceptor Observes the connection open lifecycle: ConnectionOpening, ConnectionOpened; register with DataContextBuilder.AddInterceptor or DataContext.AddInterceptor.
CommandEventData Read-only payload passed to query interceptor callbacks: the context and the command text.
ConnectionEventData Read-only payload passed to connection interceptor callbacks: the context and the opening connection.

Dependency injection

Type Description
DataContextBuilder Provider options builder: UseLoggerFactory, LogSensitiveData, Factory, UseQuotedIdentifiers, UseNamingConvention, UseMultilineBatchSql, UseCommandTimeout (exposed back as CommandTimeoutUseQueryCache, UseCacheSlidingExpiration, ), plus AddInterceptor(IQueryInterceptor)/AddInterceptor(IConnectionInterceptor).
ServiceCollectionExtensions AddNextOrmContext / AddKeyedNextOrmContext (generic and options-driven).

Namespace NextORM.Sqlite

Type Description
SqliteDataContext DataContext over Microsoft.Data.Sqlite; registers the custom aggregates.
SqliteDialect SQLite ISqlDialect singleton (Instance).
SqliteDataContextOptionsBuilderExtensions UseSqlite(string filepath) and UseSqlite(DbConnection).

Namespace NextORM.Postgres

Type Description
PostgresDataContext DataContext over Npgsql; a constructor overload takes a server Version that gates the aggregate FILTER (9.4+).
PostgresDialect PostgreSQL ISqlDialect singleton (Instance); the aggregate FILTER requires the configured server Version to be unset or 9.4+.
PostgresDataContextOptionsBuilderExtensions UsePostgres(string connectionString) and UsePostgres(DbConnection).
PostgresEntityBuilderExtensions PostgreSQL-only fluent members of EntityBuilder<TEntity>, re-exposed as extension methods — DistinctOn. Add using NextORM.Postgres;.

Namespace NextORM.SqlServer

Type Description
SqlServerDataContext DataContext over Microsoft.Data.SqlClient, with numeric column conversion. Constructors: (string connectionString, DataContextBuilder) / (DbConnection, DataContextBuilder) (unversioned and editionless, every version-gated capability off), the version-first (Version serverVersion, string connectionString) / (Version serverVersion, DbConnection), the edition-first (SqlServerEngineEdition engineEdition, string connectionString) / (SqlServerEngineEdition engineEdition, DbConnection) and the combined (Version serverVersion, SqlServerEngineEdition engineEdition, string connectionString) / (Version serverVersion, SqlServerEngineEdition engineEdition, DbConnection) — the declared major version opens the version-gated capabilities (native json from 17), a declared SqlServerEngineEdition opens the edition-derived ones (5/8/12), and both are immutable per context type.
SqlServerDialect SQL Server ISqlDialect singleton (Instance). Capabilities: SupportsJson is true for a declared major version ≥ 17 or a declared engine edition 5/8/12 (SqlDatabase, AzureSqlManagedInstance, MicrosoftFabricSqlDatabase) — a pure function of the declared state, with no server probe (the unversioned, editionless singleton keeps false), and NativeJsonProviderType is the plain CLR string — the native json column is transported as text (NVarChar parameters, no DOM value, no SqlDbType.Json).
SqlServerEngineEdition Caller-declared SQL Server engine edition, mirroring SERVERPROPERTY('EngineEdition'): PersonalOrDesktop = 1, Standard = 2, Enterprise = 3, Express = 4, SqlDatabase = 5, AzureSynapseAnalytics = 6, AzureSqlManagedInstance = 8, AzureSqlEdge = 9, AzureSynapseServerlessSqlPoolOrMicrosoftFabric = 11, MicrosoftFabricSqlDatabase = 12. The edition-derived native json capability is granted by 5/8/12 only; 11 is explicitly excluded (the serverless pool has no json column type), as are 1–4, 6, 9 and an unset edition. The value is declared, never probed — nextorm reads no server property, and an undefined value (including 0) is rejected during construction.
SqlServerDataContextOptionsBuilderExtensions UseSqlServer(string connectionString) and UseSqlServer(DbConnection).
SqlServerEntityBuilderExtensions SQL Server-only fluent members of EntityBuilder<TEntity>, re-exposed as extension methods — Pivot / Unpivot. Add using NextORM.SqlServer;. The pivot value, source-column and output-role name strings are raw names, always safely quoted.

Namespace NextORM.MySql

Type Description
MySqlDataContext DataContext over MySqlConnector.
MySqlDialect MySQL ISqlDialect singleton (Instance); non-sealed so MariaDB can derive from it.
MySqlDataContextOptionsBuilderExtensions UseMySql(string connectionString) and UseMySql(DbConnection).

Namespace NextORM.MariaDb

Type Description
MariaDbDataContext DataContext over MySqlConnector, deriving from MySqlDataContext; a constructor overload takes a server Version that enables UPDATE ... RETURNING at 13.0+.
MariaDbDialect MariaDB ISqlDialect singleton (Instance); MySQL rendering plus INTERSECT ALL/EXCEPT ALL, the MariaDB-only SqlFunctions.MySql names, and SupportsUpdateReturning enabled only at an explicit server version 13.0+.
MariaDbDataContextOptionsBuilderExtensions UseMariaDb(string connectionString) and UseMariaDb(DbConnection).

Namespace NextORM.ClickHouse

Type Description
ClickHouseDataContext DataContext over the official ClickHouse.Driver ADO.NET provider.
ClickHouseDialect ClickHouse ISqlDialect singleton (Instance).
ClickHouseDataContextOptionsBuilderExtensions UseClickHouse(string connectionString) and UseClickHouse(DbConnection).

Namespace NextORM.EntityFrameworkCore

Type Description
EntityFrameworkCoreExtensions Bridge from an EF Core DbContext to a nextorm IDataContext: CreateNextOrmContext reuses the EF connection, enlists its current transaction and registers the EF model mapping; the optional configure callback overrides nextorm defaults after provider selection. See EF Core integration.
NextOrmModelMapper Reads an EF Core IModel with Register and writes the entity mapping (table, schema, column names, key, identity/computed) into nextorm's process-wide metadata cache, so entity classes need no nextorm attributes; it also imports the model's global query filters (named/keyed and anonymous). See EF Core integration and EF Core query-filter bridge.

Namespace NextORM.Extensions

Type Description
ExtremeRowExtensions The public operators of the nextorm.extensions package, SelectWhereMin / SelectWhereMax, in four overloads. Whole-entity forms take Expression<Func<TEntity, TValue>> valueSelector, ExtremeRowTies ties = ExtremeRowTies.One and Expression<Func<TEntity, object?>>? groupBy = null, and return EntityBuilder<TEntity>; projection forms add Expression<Func<TEntity, TResult>> projection and return QueryCommand<TResult>. The package references nextorm.core only and leaves the built-in operator unchanged. See Extensions package.
ExtremeRowComponent<TEntity> The public IQueryComponent the operators attach: Slot (one stable slot, a same-slot call replaces it in place), Contribution (ExclusiveRowSource), Prepare/BuildQuery, and a descriptor whose StructuralHash/StructurallyEquals take part in the plan key. Supports ExtremeRowTies.One/All, scalar and composite value/group keys.
ExtremeKind The direction the component is constructed with (Min/Max); the extension methods choose it, so callers normally never pass it directly.
SelectGroupExtensions The grouping operators of the same package, SelectGroup / SelectGroupHaving in two overloads. Both take Expression<Func<TEntity, TResult>> projection and return QueryCommand<TResult>; SelectGroupHaving adds Expression<Func<TResult, bool>> condition, typed on the projection result (its members are rebound to the projection expressions) and AND-ed into the effective HAVING. Grouping keys are inferred from the projection only, the projection keeps its exact shape, and both forms require both generic arguments or none. See Extensions package.
SelectGroupComponent<TEntity> The public IQueryComponent the grouping operators attach: Slot, Contribution (ExclusiveGrouping), the shape state that carries the HAVING condition, Prepare and a descriptor whose StructuralHash/StructurallyEquals take part in the plan key.
SelectGroupMode The outcome the projection analysis classifies into (None, Keyed, GlobalAggregate, ConstantProjection); the component chooses it, so callers never pass it directly.

See also


Source: src/nextorm.core/**, src/nextorm.sqlite/**, src/nextorm.postgres/**, src/nextorm.sqlserver/**, src/nextorm.mysql/**, src/nextorm.mariadb/**, src/nextorm.clickhouse/**, src/nextorm.entityframeworkcore/**, src/nextorm.extensions/** (XML doc comments are the authoritative API documentation).