SQL Server · Types · The schema catalog
ArxSchemaCatalogBuilder
Definition
- Namespace
ARX.SDK.Services- Package
ARX.SDK
public sealed class ArxSchemaCatalogBuilderBuilds an ArxSchemaCatalog. Not thread-safe; build once, at startup.
Methods
ArxSchemaCatalogBuilder Column(string table, ArxColumnDefinition column)Declares a column of a table with its type. Done by a preload; by hand for a table the preload can't read.
Parameter Type Description tablestringThe table, as the database names it. columnArxColumnDefinitionThe column: its name, .NET type, database type and whether it takes null. ArxSchemaCatalogBuilder AllColumns(string table)Marks a table's declared columns as all of its columns (a preload of every column).
Parameter Type Description tablestringThe table, as the database names it. ArxSchemaCatalogBuilder Reason(string table, string reason)Why a table is in the catalog:
"requested","added: referenced by …".Parameter Type Description tablestringThe table, as the database names it. reasonstringWhy: "requested", or"added: referenced by …".ArxSchemaCatalogBuilder Note(string table, string note)Something a preload left out of a table, and why.
Parameter Type Description tablestringThe table, as the database names it. notestringWhat was left out, and why. ArxSchemaCatalogBuilder AddJson(string json)Adds the tables of a catalog written by
ToJson(a saved preload): ids, keys, lookups, display names, columns, reasons and notes. Selection sets aren't in the JSON: add them in code.Parameter Type Description jsonstringA catalog saved by ToJson.ArxSchemaCatalogBuilder Table(string name, ArxIdColumn idColumn)Declares a table and its id column, or
NoIdColumn.Parameter Type Description namestringThe table, as the database names it. idColumnArxIdColumnIts id column ( Generated{T},Supplied{T}), orNoIdColumn.bool DeclaresTable(string name)True when this builder already declares the table (with
Table).Parameter Type Description namestringThe table, as the database names it. bool DeclaresKey(string table, params string[] columns)True when this builder already declares this key of the table, its columns in any order (with
Key).Parameter Type Description tablestringThe table, as the database names it. columnsparams string[]The key's columns. bool DeclaresColumn(string table, string column)True when this builder already declares the column of the table (with
Column), its name matched ignoring case.Parameter Type Description tablestringThe table, as the database names it. columnstringThe column's name. ArxSchemaCatalogBuilder Key(string table, params string[] columns)Declares a business key of a table: one column, or several for a compound key. A table can have several keys.
Parameter Type Description tablestringThe table, as the database names it. columnsparams string[]The key's columns: one, or several for a compound key. ArxSchemaCatalogBuilder Lookup(string table, string column, string referencedTable)Declares a lookup column:
columnoftableholds the id of a record ofreferencedTable, which must be declared too. Retrieve reads it back as anArxEntityReference.Parameter Type Description tablestringThe table, as the database names it. columnstringThe column that holds the referenced record's id. referencedTablestringThe table it refers to; it must be declared with an id. ArxSchemaCatalogBuilder Version(string table, string column, bool required = false)Declares the column that holds a record's version, for optimistic concurrency: an integer column, not the id or a key. See
VersionColumn. Withrequired, an Update must carry the version it read (VersionRequired).Parameter Type Description tablestringThe table, as the database names it. columnstringThe integer column ARX sets to 1 on create and adds one to on every update. requiredbool= falseTrue to refuse an update or delete whose entity doesn't carry the version (ARX1001); false to let the last writer win. ArxSchemaCatalogBuilder Alias(string table, string attribute, string databaseName)Declares a name alias: code uses
attribute, a valid ARX name (ASCII letters, digits and underscores, starting with a letter or underscore), for the column the database namesdatabaseName, such as.Alias("customer", "first_name", "first-name"). The provider quotes and escapes the database name by its own rules, in writes, reads, filters, order, matches and keys, and reads the column back as the attribute. The table's id, keys, lookups and version are declared by their attribute names. A link entity's columns keep the identifier rule in this version.Parameter Type Description tablestringThe table, as the database names it. attributestringThe attribute (column) name. databaseNamestringThe column's name in the database, quoted by the provider's rules. ArxSchemaCatalogBuilder DisplayName(string table, string column)Declares the column that names a record of
tableto a person.Parameter Type Description tablestringThe table, as the database names it. columnstringThe column whose value is a lookup's Name.ArxSchemaCatalogBuilder DisplayName(string table, string[] columns, string delimiter = " ")Declares the columns that name a record of
table, joined bydelimiter(.DisplayName("contact", new[] { "first_name", "last_name" }, " ")). NULL parts are skipped; the delimiter may be empty.Parameter Type Description tablestringThe table, as the database names it. columnsstring[]The columns joined to make the name. delimiterstring= " "The text between them. ArxSchemaCatalogBuilder Add(ArxSelectionSetDefinition set)Adds a selection set (see
Add).Parameter Type Description setArxSelectionSetDefinitionA selection set built elsewhere. ArxSchemaCatalogBuilder Add(string name, ArxSelectionSetKind kind, params (object Value, string DisplayText)[] options)Adds a single-choice selection set.
Parameter Type Description namestringThe set's name, used when writing and reading its values. kindArxSelectionSetKindWhat its codes are: integers, text or single characters. optionsparams (object Value, string DisplayText)[]The options: each code and its display text. ArxSchemaCatalogBuilder Add(string name, ArxSelectionSetKind kind, ArxSelectionSetMultiplicity multiplicity, params (object Value, string DisplayText)[] options)Adds a selection set with the given storage form.
Parameter Type Description namestringThe set's name, used when writing and reading its values. kindArxSelectionSetKindWhat its codes are: integers, text or single characters. multiplicityArxSelectionSetMultiplicityOne option per column, or several stored as an array. optionsparams (object Value, string DisplayText)[]The options: each code and its display text. ArxSchemaCatalogBuilder AddEnum<TEnum>(string? name = null)Adds a single-choice Integer selection set from a .NET enum.
Parameter Type Description namestring?= nullThe set's name; the enum's name when null. ArxSchemaCatalogBuilder AddFlagsEnum<TEnum>(string? name = null)Adds a Flags selection set from a
[Flags]enum.Parameter Type Description namestring?= nullThe set's name; the enum's name when null. ArxSchemaCatalog Build()Builds the catalog. Throws for a table declared twice, a key of an undeclared table, or the same key twice.
Usage
Used in: