Skip to content

Schemas

Set of APIs for dealing with schemas defined in Control.

Schemas loaded from Control will automatically register meta information in the .schema data structures;

.schema.cols[`dxAlert]
/=> `time`sym`alertkey`triggered`source`tag1`tag2`description`data

.schema.tab[`dxAlert]
/=> time sym alertkey triggered source tag1 tag2 description data
-------------------------------------------------------------

.tbl.compareTableWithSchema

Compare in-memory table to Control version

Parameters:

Name Type Description
tabName symbol Name of table to compare
configProfile symbol Config profile. Use a null symbol or .ex.configprofile.
schemaName symbol Schema name

Returns:

Type Description
table Table of meta info joined from both tables. See example for full format

Example:

 .tbl.compareTableWithSchema[`dfxTrade; `; `dfxTrade]
 /=> column  idx dataType  dataTypeChar attribute columnNew idxNew dataTypeNew dataTypeCharNew attributeNew defaultNew
 /=> -----------------------------------------------------------------------------------------------------------------
 /=> time    0   Timestamp p                      time      0      Timestamp   p                            0Np
 /=> sym     1   Symbol    s            g         sym       1      Symbol      s               g            `
 /=> price   2   Float     f                      price     2      Float       f                            0n
 /=> size    3   Integer   i                      size      3      Integer     i                            0Ni
 /=> seqNum  4   Long      j                      seqNum    4      Long        j                            0N
 /=> src     5   Symbol    s                      src       5      Symbol      s                            `
 /=> srcTime 6   Timestamp p                      srcTime   6      Timestamp   p                            0Np
 /=> cond    7   Symbol    s                      cond      7      Symbol      s                            `
 /=> status  8   Symbol    s                      status    8      Symbol      s                            `
 /=> side    9   Character c                      side      9      Character   c                            " "
 /=> msgrcv  10  Timestamp p                      msgrcv    10     Timestamp   p                            0Np

.tbl.getLoadedSchemas

Returns the list of loaded schemas

Returns:

Type Description
symbol[] Schema list

Example:

 .tbl.getLoadedSchemas[]
 /=> `dfxAsk`dfxBbo`dfxBid`dfxBookSnapshot`dfxOrder`dfxQuote`dfxQuote_midprice`dfxTrade..

.tbl.getinfo

Gets schema meta information at the version the process is operating at. If an empty list is input, information on all schema is returned.

Parameter:

Name Type Description
tbls symbol[] Schema names

Returns:

Type Description
table Schema meta information

Example:

 .tbl.getinfo[`schema1]
 /=> table    keycols colnames     coltype                 colattr tablegroup
 /=> ------------------------------------------------------------------------
 /=> schema1          time sym src Timestamp Symbol Symbol  g      dtxFX

.tbl.gettable

Loads a schema into memory.

Parameter:

Name Type Description
t symbol Schema name

Example:

 .tbl.gettable[`dfxTrade]

.tbl.gettabledetails

Gets schema meta information. Executed on Control as deltacomponent. If deltacomponent is configured to be a non-Administrator user then the results will be subject to a permission check.

Parameter:

Name Type Description
n symbol Schema name

Example:

 .tbl.gettabledetails[`dfxTrade]
 /=> ucname      | `delta_install_default
 /=> table       | `dfxTrade
 /=> keycols     | `symbol$()
 /=> description | "Schema for the dfxTrade table"
 /=> colnames    | `time`sym`price`size`seqNum`src`srcTime`cond`status`side`msgrcv
 /=> coltype     | `Timestamp`Symbol`Float`Integer`Long`Symbol`Timestamp`Symbol`Symbol`Character`Timestamp
 /=> default     | ("";"";"";"";"";"";"";"";"";"";"")
 /=> colattr     | ``g`````````
 /=> coldesc     | ("";"";"";"";"";"";"";"";"";"";"")
 /=> schemagroups| ,`dtxFX

.tbl.gettablesbygroup

Returns the list of schemas for a group

Parameter:

Name Type Description
r symbol Schema group

Returns:

Type Description
symbol[] Schema list

Example:

 .tbl.gettablesbygroup[`DM_Monitoring]
 /=> `.yday.dmxJobScheduling`.yday.dmxJobSummary`dmxFileChange`dmxFiles`dmxJobScheduling`dmxJobSummary`dmxPing..

.tbl.loadgrouptables

Loads all schemas for a group.

Parameter:

Name Type Description
s symbol Schema group

Example:

 .tbl.loadgrouptables[`dtxFX]

.tbl.loadtables

Loads a list of schemas

Parameter:

Name Type Description
m symbol[] Schema list

Example:

 .tbl.loadtables[`dfxTrade`dfxQuote]

.tbl.regTab

Registers meta information for a table. Populates the table schema and columns in .schema.tab and .schema.cols structures respectively. Structures can be accessed directly.

Handled automatically for schemas loaded from Control.

Parameter:

Name Type Description
name symbol Table name

Example:

 .tbl.regTab[`dxQuote]