SQL Server · Types · The schema catalog

ArxSchemaCatalog

Definition

Namespace
ARX.SDK.Services
Package
ARX.SDK
C#
public sealed class ArxSchemaCatalog : IArxSelectionSetCatalog

What the developer declares about the database: every table's id column and keys, and the selection sets. Build it once at startup and give it to the service: new ArxMsSqlDbService(connectionString, schema). ARX never reads ids, keys or option tables from the database by itself. Immutable and thread-safe.

Properties

  • IReadOnlyCollection<ArxTableDefinition> Tables { get; }

    Every declared table, in the order added.

  • ArxSelectionSetCatalog SelectionSets { get; }

    The selection sets.

Methods

  • string ToJson()

    The catalog's tables as JSON: ids, keys, lookups, display names, columns with their types, and for a preload the reason each table was added and its notes. Reload it with ArxSchemaCatalog.Create().AddJson(json). Selection sets aren't written: they are code. ARX doesn't write the file: the application decides.

  • static ArxSchemaCatalogBuilder Create()

    Starts a catalog: declare each table's id, keys, lookups and selection sets, then call Build.

  • bool TryGetTable(string name, out ArxTableDefinition table)

    Finds a table by its exact name (table names are case-sensitive).

    Parameter Type Description
    namestringThe table, as the database names it.
    tableout ArxTableDefinitionThe table's declaration when found; otherwise null.
  • string? ClosestTable(string name)

    The declared table whose name is closest to name, for an error that names an undeclared table: the same letters in another case first (table names are case-sensitive), then a name within two edits (acount for account). Null when no declared name is that close.

    Parameter Type Description
    namestringA table name the catalog doesn't declare.
  • bool TryGetSet(string name, out ArxSelectionSetDefinition set)

    Gets a selection set by name; false when the catalog has none of that name.

    Parameter Type Description
    namestringThe selection set's name.
    setout ArxSelectionSetDefinitionThe set when found; otherwise null.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

var schema = ArxSchemaCatalog.Create()

Create one record and get its id, scenario 1

Used in: