Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
breakoutModewide
breakoutWidth760
languagejs
const gridRowSchema = s.obj({
  data: s.vec(s.con('')),
  metadata: s.obj({
    synapseRow: s.obj({
      rowId: s.con(0),

     versionNumber: s.con(0),
      etag: s.con(''),
    }),
    rowValidation: s.con(0)
  }),
});

const gridSchema = s.obj({
  doc_version: s.con('0.1.0'),
  columnNames: s.vec(s.con('')),
  columnOrder: s.arr([s.con(0)]),
  rows: s.arr([gridRowSchema]),
});

name

description

doc_version

The semantic version of the document schema. This value will change anytime we change this schema.

columnNames

This vector captures the name of the columns in their natural order (order they were added). Vectors are append-only (up to 256 values). Vectors allow LWW changes to each index.

columnOrder

This array defines the order that the columns should be displayed. Each value is an index into the columnNames. The array can be reordered.

rows

This is an arr of ‘row’ objects. The arr is the mutable row order. Each obj contains two properties: data and metadata.

rows[*].data

The row data vec represents the data in a row. The order of the vec matches the columnNames vector (append-only). Each cell in a row’s vector can be changed to a new con. Cells with identical values will share a reference to a single constant (con) (typically).

rows[*].metadata

The row metadata is an obj that contains supplemental information about the row.

The object might be omitted if no additional information is included.

This data should be treated as read-only for all replicas other than the hub.

rows[*].metadata.synapseRow

The synapseRow object value is a reference to a constant containing the JSON serialization of an array that contains in order: [<rowId>, <rowVersion>, <etag>]. It can be used to map a row back to its source from a Synapse Table or View. The synapseRow is omitted if all the items are not defined.

rowValidation: s.con(0)rows[*].metadata.rowValidation

The rowValidation value is a reference to a constant containing the JSON serialization of a: the ValidationResult object. Note: The ValidationResult is identical to results provided for Entity Validation.

...