Skip to main content

Record Syntax

JSON Format

A single record may be encoded as a JSON object:

Property Value
<field name / label> field type appropriate value / null
"expressions" JSON object mapping field name/label to expression
"file" binary object (if database has file enabled)
"tags" JSON array of string(s) (if database has tag enabled)

The "expressions" property allows field values to be specified by expression, rather than explicit value. Between the base object and "expressions" object, field may only have a single value provided, or an error will be thrown.

Multiple records may be encoded as a JSON array of JSON objects in this format.

DSV Format

Certain types of data may be provided in a delimiter separated values format.

The default format of the separated values files is largely based on the RFC 4180 standard. The specific requirements are:

  • lines end with CR LF
  • line breaks cannot be used in values
  • any field may be escaped
  • the default quote character is " (double quotes)
  • any field containing the delimiter must be quoted
  • an escape character in an escaped field must be represented by two escape characters
  • the first record (row) must contain the names of each field
  • blank lines with no data are ignored

DSV

The basic DSV format must explicitly specify a delimiter.

 {
  "type":      "dsv",
  "object_id": <string>,
  "delimit":   <string>,
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }

TSV

The TSV format uses TAB (\t) as the default delimiter, but it may be overridden.

 {
  "type":      "tsv",
  "object_id": <string>,
  "delimit":   <string>, (optional)
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }

CSV

The CSV format uses , (comma) as the default delimiter, but it may be overridden.

 {
  "type":      "csv",
  "object_id": <string>,
  "delimit":   <string>, (optional)
  "quote":     <string>, (optional)
  "line":      <string>  (optional)
 }