PostgreSQL · Types · Services and connections
ArxPgDbService
Definition
- Namespace
ARX.SDK.PostgreSql.Services- Package
ARX.SDK.PostgreSql
public class ArxPgDbServiceThe PostgreSQL service: Create, Update, Delete, Retrieve, RetrieveMultiple and Execute against one database. Give it the connection string and, usually, the application's schema catalog. It holds no connection (each call takes one from the pool), so one instance serves the whole application.
Constructor
ArxPgDbService(string connectionString)A service with no schema catalog: before a call, it reads from the database what the call needs to know about each table (its id column, keys and column types), so simple CRUD works with only a connection string. That read costs a round trip per call unless
RememberResolvedTableskeeps it; a table with no usable id (none, or a compound one) is ARX1019 when the call needs one. Pass a schema catalog instead to declare the tables once.Parameter Type Description connectionStringstringThe Npgsql connection string. ArxPgDbService(string connectionString, ArxSchemaCatalog schema)A service with the application's schema catalog: the usual way.
Parameter Type Description connectionStringstringThe Npgsql connection string. schemaArxSchemaCatalogThe developer's schema catalog: every table's id column and keys, and the selection sets that ArxSelectionSetValueattributes are checked against. ARX never reads ids, keys or option tables from the database by itself. Without it, creating a record fails with ARX1016 unless the entity declares its ownIdColumn.
Properties
string ConnectionString { get; }The Npgsql connection string each call opens its connection with.
ArxSchemaCatalog Schema { get; }The developer's schema catalog (table keys and selection sets); null when none was supplied.
IArxSelectionSetCatalog SelectionSetCatalog { get; }The catalog
ArxSelectionSetValueattributes are checked against; null when none was supplied.IArxProviderCapabilities Capabilities { get; }What PostgreSQL supports through ARX: joins, aggregates, paging by page number with the total, transactions and batch scopes, the multiple-row writes and writes by a filter, Execute, full-text search, pattern conditions and Or filters. Not token paging (
PageInfo.PagingCookieis ARX8001: page by page number), not upsert, not named secondary indexes (the database chooses its indexes).bool RememberResolvedTables { get; set; }Without a schema catalog, keep what was resolved about each table for this service's lifetime instead of reading it again on every call. Off by default: every call then reads its tables again, always current, at the cost of extra round trips. On: each table is read once, the first time a call needs it; a schema change after that needs a new service. Has no effect on a service with a catalog, which never resolves.
bool Strict { get; set; }False (the default): a preloaded schema is what ARX knows ahead of time; tables and columns it doesn't list still work. True: the preloaded columns are an allow list. A call that names a table or a column the schema doesn't preload (written, matched, read, filtered, ordered, grouped, joined) is refused before the database with ARX1018 NotPreloaded, and reading all columns reads only the preloaded ones. Function row sources and Execute aren't covered: their columns are the routine's.
Methods
Task<IArxBatchScope> BeginBatchAsync(ArxBatchOptions? options = null, CancellationToken cancellationToken = default)Opens a connection and a transaction for a batch scope with manual commit. For automatic commit, use
RunBatchAsync.Parameter Type Description optionsArxBatchOptions?= nullThe scope's options; null for the defaults (no savepoints). cancellationTokenCancellationToken= defaultCancels the call. Task<ArxTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default)Begins a transaction on a connection of its own (a new
ArxPgConnection), for code that works throughIArxDataServiceand so can't name the provider's connection type. Pass it to the calls, then commit it; disposing it without committing rolls it back, and closes its connection:await using var transaction = await service.BeginTransactionAsync();Parameter Type Description cancellationTokenCancellationToken= defaultCancels the call. Task<ArxRecordId> CreateAsync(ArxEntity entity, CancellationToken cancellationToken = default)Inserts one entity and returns its id, which is also set on
RecordId. A table declared NoIdColumn givesNone.Parameter Type Description entityArxEntityThe record to create: its table and the attributes to write. Its RecordIdis set to the new id.cancellationTokenCancellationToken= defaultCancels the call. Task<ArxRecordId> CreateAsync(ArxEntity entity, ArxTransaction transaction, CancellationToken cancellationToken = default)Inserts one entity inside an ARX transaction and returns its id, which is also set on
RecordId. Nothing is visible to other connections until the transaction commits.Parameter Type Description entityArxEntityThe record to create: its table and the attributes to write. Its RecordIdis set to the new id.transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entityList, CancellationToken cancellationToken = default)Inserts all entities and returns their ids: one per entity, in list order, the same instances that are set on each entity's
RecordId. A table declared NoIdColumn givesNone.Parameter Type Description entityListIReadOnlyList<ArxEntity>The records to create, all or nothing; their ids come back in the same order. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxTransaction transaction, CancellationToken cancellationToken = default)Inserts all entities inside an ARX transaction, all or nothing, and returns their ids, as
CreateMultipleAsyncdoes. Nothing is visible to other connections until the transaction commits.Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to create, all or nothing; their ids come back in the same order. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, CancellationToken cancellationToken = default)Inserts all entities with
schemaoverriding the service's schema for this call only, and returns their ids, asCreateMultipleAsyncdoes.Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to create, all or nothing; their ids come back in the same order. schemaArxSchemaCatalogDeclarations for this call only: they replace the service's for the tables they declare. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, ArxTransaction transaction, CancellationToken cancellationToken = default)CreateMultipleAsyncinside an ARX transaction:schemadeclares the tables for this call, and the entities mustn't.Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to create, all or nothing; their ids come back in the same order. schemaArxSchemaCatalogDeclarations for this call only: they replace the service's for the tables they declare. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxCreateMultipleOptions options, CancellationToken cancellationToken = default)Creates the records, all or nothing. With
ReturnIdsfalse every id returned isNone, and a group of 5,000 rows or more of one shape goes in by binaryCOPY(one per group, in one transaction); smaller groups take the ordinary statement, which was faster below that size (results/2026-11-11-create-without-ids.md). With ReturnIds true, the same asCreateMultipleAsync.Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to create, all or nothing. optionsArxCreateMultipleOptionsReturnIds false to skip reading the ids back. cancellationTokenCancellationToken= defaultCancels the call. Task<IReadOnlyList<ArxRecordId>> CreateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxCreateMultipleOptions options, ArxTransaction transaction, CancellationToken cancellationToken = default)CreateMultiple with options inside an ARX transaction. A database error aborts the transaction.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to create, all or nothing. optionsArxCreateMultipleOptionsReturnIds false to skip reading the ids back. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<bool> DeleteAsync(string entityName, ArxRecordId id, CancellationToken cancellationToken = default)Deletes the record with this id: true when it was there.
Parameter Type Description entityNamestringThe table to delete from. idArxRecordIdThe record's id: the value Create returned, or a plain value of the declared id's type. cancellationTokenCancellationToken= defaultCancels the call. Task<bool> DeleteAsync(string entityName, ArxRecordId id, ArxTransaction transaction, CancellationToken cancellationToken = default)Deletes the record with this id in an ARX transaction: true when it was there.
Parameter Type Description entityNamestringThe table to delete from. idArxRecordIdThe record's id: the value Create returned, or a plain value of the declared id's type. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteAsync(ArxEntity entity, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)Deletes the rows
entitymatches and returns how many went: by default by the table's id (RecordId or the id attribute), or by a declared key or any columns (Match), whose values come from the entity's attributes. Attributes outside the match are ignored, so an entity read or created earlier can be passed as it is.Parameter Type Description entityArxEntityThe record to delete: its table and the id, key or columns that find it. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteAsync(ArxEntity entity, ArxTransaction transaction, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)DeleteAsyncinside an ARX transaction. A database error or a failed RequireSingleRow check aborts the transaction.Parameter Type Description entityArxEntityThe record to delete: its table and the id, key or columns that find it. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync<TId>(string entityName, IReadOnlyCollection<TId> ids, CancellationToken cancellationToken = default)Deletes the records with these ids, all or nothing, and returns how many existed. Ids that match nothing aren't an error: the count shows them. Duplicates count once. An empty list returns 0 without touching the database. One method for every id type (1.0.0-rc.1): a list of
long,int,Guid,stringorArxRecordId; another element type is ARX1007 UnsupportedValueType.Parameter Type Description entityNamestringThe table to delete from. idsIReadOnlyCollection<TId>The ids of the records to delete; ids that match nothing are left out of the count. cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync<TId>(string entityName, IReadOnlyCollection<TId> ids, ArxTransaction transaction, CancellationToken cancellationToken = default)Deletes the records with these ids, all or nothing, and returns how many existed, inside an ARX transaction. Ids that match nothing aren't an error: the count shows them. Duplicates count once. An empty list returns 0 without touching the database. One method for every id type (1.0.0-rc.1): a list of
long,int,Guid,stringorArxRecordId; another element type is ARX1007 UnsupportedValueType.Parameter Type Description entityNamestringThe table to delete from. idsIReadOnlyCollection<TId>The ids of the records to delete; ids that match nothing are left out of the count. transactionArxTransactionThe ARX transaction to run in. ARX doesn't commit or roll it back. cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)Deletes the rows the entities match, all or nothing, and returns how many went. Every entity uses the same match (
Match): by id, by a declared key, or by any columns, whose values come from the entity's attributes; other attributes are ignored. Compound keys go as parallel arrays in one statement (DELETE … USING unnest(…)). Not strict by default: duplicates count once and nothing matching is 0. With RequireSingleRow each entity must delete exactly one row (ARX2002 or ARX2003 otherwise, nothing deleted).Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to delete, all or nothing, each found by its id or by the match's columns. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)DeleteMultiple with
schemaoverriding the service's schema for this call, as for CreateMultiple. Entities in the call mustn't declare their own id column or keys (ARX1001).Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to delete, all or nothing, each found by its id or by the match's columns. schemaArxSchemaCatalogThe schema catalog: each table's id, keys, lookups and columns, and the selection sets. Null for none. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxTransaction transaction, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)DeleteMultiple by entities inside an ARX transaction.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to delete, all or nothing, each found by its id or by the match's columns. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, ArxTransaction transaction, ArxDeleteOptions? options = null, CancellationToken cancellationToken = default)DeleteMultiple by entities with a schema for this call, inside an ARX transaction.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The records to delete, all or nothing, each found by its id or by the match's columns. schemaArxSchemaCatalogThe schema catalog: each table's id, keys, lookups and columns, and the selection sets. Null for none. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxDeleteOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<ArxExecuteResult> ExecuteAsync(ArxProcedureExpression procedure, ArxExecuteOptions? options = null, CancellationToken cancellationToken = default)Calls a stored procedure or a function the database owns on ARX's own connection. A procedure runs as
CALLoutside any transaction block, so it may commit by itself; OUT and INOUT values come back inOutputs, the tables it returns through cursor parameters inResultSets(read in one transaction). A function runs asSELECT * FROM; its rows areResultSets[0], paged whenPageInfois set.Parameter Type Description procedureArxProcedureExpressionThe procedure or function to call, with its arguments. optionsArxExecuteOptions?= nullOptions of the call (paging, command timeout); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxExecuteResult> ExecuteAsync(ArxProcedureExpression procedure, ArxTransaction transaction, ArxExecuteOptions? options = null, CancellationToken cancellationToken = default)Calls a routine inside an ARX transaction: its writes are part of it, and a failed call aborts it. A procedure that commits by itself is ARX8001.
Parameter Type Description procedureArxProcedureExpressionThe procedure or function to call, with its arguments. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxExecuteOptions?= nullOptions of the call (paging, command timeout); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(ArxEntity values, ArxFilterExpression filter, ArxFilterWriteOptions? options = null, CancellationToken cancellationToken = default)Sets
values' attributes on every row of its table thatfiltermatches, in oneUPDATE … SET … WHERE …, and returns how many rows changed.Parameter Type Description valuesArxEntityThe table (EntityName) and the attributes to set: null clears a column. filterArxFilterExpressionThe rows to change: conditions on the table's own columns. optionsArxFilterWriteOptions?= nullAllRows for an empty filter; null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(ArxEntity values, ArxFilterExpression filter, ArxTransaction transaction, ArxFilterWriteOptions? options = null, CancellationToken cancellationToken = default)The update by a filter inside an ARX transaction. A database error aborts the transaction.
Parameter Type Description valuesArxEntityThe table (EntityName) and the attributes to set: null clears a column. filterArxFilterExpressionThe rows to change: conditions on the table's own columns. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxFilterWriteOptions?= nullAllRows for an empty filter; null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(string entityName, ArxFilterExpression filter, ArxFilterWriteOptions? options = null, CancellationToken cancellationToken = default)Deletes every row of the table that
filtermatches, in oneDELETE … WHERE …, and returns how many went. The filter's rules are the update's: the table's own columns, and an empty filter is ARX1001 unlessAllRowsis set.Parameter Type Description entityNamestringThe table to delete from. filterArxFilterExpressionThe rows to delete: conditions on the table's own columns. optionsArxFilterWriteOptions?= nullAllRows for an empty filter; null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<int> DeleteMultipleAsync(string entityName, ArxFilterExpression filter, ArxTransaction transaction, ArxFilterWriteOptions? options = null, CancellationToken cancellationToken = default)The delete by a filter inside an ARX transaction. A database error aborts the transaction.
Parameter Type Description entityNamestringThe table to delete from. filterArxFilterExpressionThe rows to delete: conditions on the table's own columns. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxFilterWriteOptions?= nullAllRows for an empty filter; null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntity?> RetrieveAsync(string entityName, ArxRecordId id, ArxColumnSet? columns = null, CancellationToken cancellationToken = default)Reads one record by the id Create returned; null when not found.
Parameter Type Description entityNamestringThe table or view to read. idArxRecordIdThe record's id: the value Create returned, or a plain value of the declared id's type. columnsArxColumnSet?= nullThe columns to read; null or an empty set reads every column. The declared id is always read. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntity?> RetrieveAsync(string entityName, ArxRecordId id, ArxTransaction transaction, ArxColumnSet? columns = null, CancellationToken cancellationToken = default)Retrieve by the id Create returned inside an ARX transaction.
Parameter Type Description entityNamestringThe table or view to read. idArxRecordIdThe record's id: the value Create returned, or a plain value of the declared id's type. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. columnsArxColumnSet?= nullThe columns to read; null or an empty set reads every column. The declared id is always read. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntity?> RetrieveAsync(ArxEntity match, ArxRetrieveOptions? options = null, CancellationToken cancellationToken = default)Reads the one record
matchidentifies: by its id (the default), a declared key or any columns (Match, anArxMatch), with the match values taken from its attributes. Null when nothing matches; ARX2003 when a key or columns match more than one row.Parameter Type Description matchArxEntityThe record to find: its table, and the values of the id, the declared key or the columns that find it. optionsArxRetrieveOptions?= nullHow the row is found and read (match, command timeout, lookup names); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntity?> RetrieveAsync(ArxEntity match, ArxTransaction transaction, ArxRetrieveOptions? options = null, CancellationToken cancellationToken = default)Retrieve by a match inside an ARX transaction.
Parameter Type Description matchArxEntityThe record to find: its table, and the values of the id, the declared key or the columns that find it. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxRetrieveOptions?= nullHow the row is found and read (match, command timeout, lookup names); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntityCollection> RetrieveMultipleAsync(ArxQueryExpression query, ArxRetrieveOptions? options = null, CancellationToken cancellationToken = default)Runs a query on a table, view, materialized view or function (
Source): its columns (includingcolumn._lk.table.columnsdirect joins), criteria, link entities, order, paging, distinct and aggregates. Every name is validated and quoted, every value sent as a parameter.Parameter Type Description queryArxQueryExpressionThe query: its row source, columns, criteria, links, order, paging and aggregates. optionsArxRetrieveOptions?= nullHow the row is found and read (match, command timeout, lookup names); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task<ArxEntityCollection> RetrieveMultipleAsync(ArxQueryExpression query, ArxTransaction transaction, ArxRetrieveOptions? options = null, CancellationToken cancellationToken = default)RetrieveMultiple inside an ARX transaction: it sees the transaction's own uncommitted writes.
Parameter Type Description queryArxQueryExpressionThe query: its row source, columns, criteria, links, order, paging and aggregates. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxRetrieveOptions?= nullHow the row is found and read (match, command timeout, lookup names); null for the defaults. cancellationTokenCancellationToken= defaultCancels the call. Task ValidateSchemaAsync(CancellationToken cancellationToken = default)Compares every table in the schema catalog with the database: the table exists; its id column exists with a compatible type, identifies one row on its own (it is the primary key, or has a unique constraint or index of its own), and has a default or is an identity column when declared generated; and every declared key's columns exist and have a unique constraint or index on exactly those columns. Tables declared
NoIdColumnskip the id checks.Parameter Type Description cancellationTokenCancellationToken= defaultCancels the call. Task<ArxServerCheck> CheckServerAsync(CancellationToken cancellationToken = default)What the connected server allows: connects once and returns the server's version and the provider's capabilities on it. Every capability of this provider works on any supported server, so the check finds no limits; a server it can't reach is the error a call would get (ARX7005, ARX6001, …). Call it once at startup.
Parameter Type Description cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateAsync(ArxEntity entity, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)Updates the row
entityidentifies and returns how many rows changed.Parameter Type Description entityArxEntityThe change: its table, the attributes to write (null clears a column; an attribute left out keeps its value), and the id, key or columns that find the row. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateAsync(ArxEntity entity, ArxTransaction transaction, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)UpdateAsyncinside an ARX transaction. A validation error or ARX2002 when nothing matched leaves the transaction usable; a database error, or a failed RequireSingleRow check, aborts it.Parameter Type Description entityArxEntityThe change: its table, the attributes to write (null clears a column; an attribute left out keeps its value), and the id, key or columns that find the row. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)Updates every entity, all or nothing, and returns the rows changed.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The changes, all or nothing: each carries the attributes to write and what finds its row. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)UpdateMultiple with
schemaoverriding the service's schema for this call (per table and per selection set, as for CreateMultiple). Entities in the call mustn't declare their own id column or keys (ARX1001).Parameter Type Description entitiesIReadOnlyList<ArxEntity>The changes, all or nothing: each carries the attributes to write and what finds its row. schemaArxSchemaCatalogThe schema catalog: each table's id, keys, lookups and columns, and the selection sets. Null for none. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxTransaction transaction, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)UpdateMultiple inside an ARX transaction. A database error or a failed check aborts the transaction.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The changes, all or nothing: each carries the attributes to write and what finds its row. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call. Task<int> UpdateMultipleAsync(IReadOnlyList<ArxEntity> entities, ArxSchemaCatalog schema, ArxTransaction transaction, ArxUpdateOptions? options = null, CancellationToken cancellationToken = default)UpdateMultiple with a schema for this call, inside an ARX transaction.
Parameter Type Description entitiesIReadOnlyList<ArxEntity>The changes, all or nothing: each carries the attributes to write and what finds its row. schemaArxSchemaCatalogThe schema catalog: each table's id, keys, lookups and columns, and the selection sets. Null for none. transactionArxTransactionThe ARX transaction to run in (from the provider's connection type). ARX doesn't commit or roll it back. optionsArxUpdateOptions?= nullHow the rows are found ( Match) and checked; null for the defaults (by id).cancellationTokenCancellationToken= defaultCancels the call.
Usage
A line from a verified sample; the full, runnable code is on its page.
var service = new ArxPgDbService(connectionString, schema);Create one record and get its id, scenario 1
Used in:
- Create one record and get its idCreate
- Create a record that points at another oneCreate
- Catch an error by its codeCreate
- Ids that aren't numbers: text and uuidCreate
- Where to declare: on the entity, or a schema for one call, never bothCreate
- Create without a catalogCreate
- Picklist values checked against the application's catalogCreate
- Register ARX in a DI container and inject itCreate
- Load ids and keys from JSON and validate them at startupCreate
- Write to two databases, each with its own serviceCreate
- Preload the schema at service setup: keys only, data types, StrictCreate
- Use columns named outside the name rule, through aliasesCreate
- Remember resolved tables, or preload themCreate
- Create many records in one call and get their idsCreateMultiple
- Create many records without a catalogCreateMultiple
- Create many records without reading their idsCreateMultiple
- Update one recordUpdate
- Clear a value, keep the othersUpdate
- Catch a record that doesn't existUpdate
- Find rows by id, by key or by columnsUpdate
- Update without a catalogUpdate
- Update on a preloaded schema: keys only, data types, StrictUpdate
- Update many records in one callUpdateMultiple
- Update many records without a catalogUpdateMultiple
- Update every row a filter matchesUpdateMultiple
- Delete one recordDelete
- Nothing to delete is not an errorDelete
- Delete by key, by compound key, by columnsDelete
- Delete without a catalogDelete
- Delete on a preloaded schema: keys only, StrictDelete
- Delete many records in one callDeleteMultiple
- Delete many records without a catalogDeleteMultiple
- Delete every row a filter matchesDeleteMultiple
- Retrieve one recordRetrieve
- Choose the columns to readRetrieve
- Find a record by id, key or columnsRetrieve
- Retrieve without a catalogRetrieve
- Retrieve many records with a queryRetrieveMultiple
- Page through resultsRetrieveMultiple
- Query without a catalogRetrieveMultiple
- Read a viewRetrieveMultiple
- Views in depth: computed criteria, links both ways, declared ids and lookups, column boundariesRetrieveMultiple
- Retrieve on a preloaded schema: lookups found, enums typed, Strict, saved JSONRetrieveMultiple
- Call a stored procedureExecute
- Execute on a preloaded, Strict schema: routines aren't covered, tables areExecute
- The sample application