Simple table
Variant |
Variant "storageEncoding" |
Variant ID |
FairCom C Constant |
|---|---|---|---|
|
|
|
N/A |
|
|
|
N/A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(It is currently named
|
|
|
|
|
(It is currently named
|
|
|
|
|
|
|
|
|
Detailed table
Variant |
Variant "storageEncoding" |
Variant ID |
FairCom C Constant |
Variant Object Examples |
Description |
|---|---|---|---|---|---|
|
|
|
N/A |
Invalid variant object:
Invalid maximal variant object:
|
Zero represents an invalid variant type.
An invalid variant type should never exist. It may be possible that an unexpected error creates an invalid variant field value.
When the server encounters an invalid variant type, it a:ttempts to correct it. If the field is nullable, the server replaces the field value with the null flag. If the field is not nullable, the server stores a JSON null value in the field.
If the server cannot correct the problem, it returns a variant object with the
|
|
|
|
N/A |
Minimal
Maximal
JSON
|
This type is identified by
A variant field can have a null value like any other field.
When a variant object's
The server efficiently stores a null value in the record as a bit flag so that a null field consumes no additional storage space.
If the variant field is not nullable, assigning a null value to the variant field returns an error.
If a variant field is nullable and its value is null, the server returns the variant object type as
FairCom's SQL, ISAM, CTDB, and JSON APIs receive and return the raw value as null.
|
|
|
|
|
GIF image encoded as Base64 and stored as a binary value:
GIF image encoded as hexadecimal and stored as a binary value:
GIF image encoded as an array of bytes and stored as a binary value:
|
This type is identified by
A binary variant value is a series of bytes up to 2 GB in length. The server stores bytes in the exact order as received.
The server does not validate a binary value.
FairCom's ISAM and CTDB APIs receive and return the raw bytes.
FairCom SQL receives and returns a variant object that may contain a binary value. When receiving a variant object, the server uses the
JSON APIs receive and return a binary value by embedding it in a JSON string or as an array of bytes. The |
|
|
|
|
Minimal string variant object:
Maximal string variant object:
|
This type is identified by
A string is a variable-length, series of UTF-8 code points up to 2 GB in length.
The server validates and stores the value as a UTF-8 string. It also decodes all JSON escaped characters into their raw binary form and stores them without JSON's double quotes. For example, it takes the JSON string,
FairCom's ISAM and CTDB APIs store a string AS IS and return it AS IS.
FairCom SQL receives and returns a variant object with the
JSON APIs receive and return a variant string as a JSON string or a variant object containing a JSON string. The server converts between the JSON string and the stored string. |
|
|
|
|
Minimal number variant object:
Minimal number variant object embedded in a string:
Maximal number variant object embedded in a string:
Maximal number variant object using exponential notation:
|
This type is identified by
The server validates the value as a JSON number and stores it as a JSON number, which is a series of UTF-8 numeric digits with optional exponential number notation. This format is inefficient, but it is a lossless, limitless, base-ten number with an unlimited number of floating-point digits. JSON does not support infinity, +infinity, -infinity, or NaN.
A JSON number is stored AS IS. For example the ASCII characters in the following JSON numbers are stored without change: -1.602176634e-19 and -123.456. If a number is embedded in a string, it is removed from the string and stored AS IS. Thus,
The server accepts a number embedded in a JSON string. Because the embedding is obvious, the "valueEncoding" property does not specify an encoding.
Embedding a number in a string is important to avoid a problem in some JSON parsers and languages that mangle base-ten JSON numbers by automatically converting them into base-two IEEE floating point numbers.
FairCom's CTDB API converts between a variable and the stored JSON number. A conversion between base-ten and base-two numbers will introduce rounding errors. Conversion may also reduce precision, truncate a number's fractional part, or return an error if the conversion fails.
FairCom SQL receives and returns a variant object. It directly stores and retrieves the JSON number in the
JSON APIs receive and return a variant number as a JSON number, a JSON number embedded in a string, or a JSON number in a variant object. The |
|
|
|
|
Minimal boolean variant object:
Maximal boolean variant object:
|
This type is identified by
The server validates the value as a JSON true or false and stores a single byte containing 1 for true and 0 for false.
FairCom's CTDB API converts the value in a variable to the raw value and vice-versa.
FairCom SQL receives and returns a variant object. The server converts between the stored value and the JSON boolean value of true or false.
JSON APIs receive and return a JSON boolean value or a variant object. The server converts between the stored value and the JSON boolean value of true or false.
|
|
|
|
|
JSON string in a maximal variant object:
JSON string in a minimal variant object:
JSON number in the default minimal variant object:
JSON boolean in the default minimal variant object:
JSON object in the default minimal variant object:
JSON array in the default minimal variant object:
|
This type is identified by
A JSON value may be an object, array, string, number, true, false, or null.
The server validates the JSON value and returns an error if it is invalid JSON. It stores the JSON value AS IS. The internal FairCom parsers should validate the JSON, but the server should store the original JSON. This ensures the parser does not mangle the numbers. It also preserves the original whitespace, which lets the user optimize the whitespace to meet their needs for readability or performance.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the JSON value AS IS.
JSON objects and arrays are stored AS IS.
A JSON string is stored AS IS including its double quote characters and JSON escaped characters. For example, the server stores each byte of the following JSON string AS IS:
A JSON number is stored AS IS. For example the ASCII characters in the following JSON numbers are stored without change: -1.602176634e-19 and -123.456. If a number is embedded in a string, it is removed from the string and stored AS IS. Thus,
A JSON boolean is stored AS IS. For example the ASCII characters in the following JSON booleans are stored without change: true and false. Contrast this approach with the variant boolean type.
A JSON null value is stored as a null field value. If a variant field is not nullable, the server returns an error.
|
|
|
|
|
|
This type is identified by
The server converts a number to an 8-bit signed integer and stores its binary value. The server truncates the number's fractional parts.
The number's range is from -128 to 127. If the number exceeds the range, the server fails the operation and reports an error.
The server accepts a number embedded in a JSON string. Because the embedding is obvious, the
FairCom's CTDB API converts between a variable and the stored number. A conversion between base-ten and base-two numbers will introduce rounding errors. Conversion may also reduce precision, truncate a number's fractional part, or return an error if the conversion fails.
FairCom SQL receives and returns a variant object. The server converts from the JSON number in the
JSON APIs receive and return a variant number as a JSON number, a JSON number embedded in a string, or a JSON number in a variant object. The server converts from the JSON number in the
The server can accept any valid exponential encoding of a number, such as 3e2. When it generates a JSON number from the stored binary number, it may produce a simpler encoding, such as 30. |
|
|
|
|
|
This type is identified by
The server converts a number to a 16-bit signed integer and stores its binary value. The server truncates the number's fractional parts.
The number's range is from -32,768 to 32,767. If the number exceeds the range, the server fails the operation and reports an error.
See |
|
|
|
|
|
This type is identified by
The server converts a number to a 32-bit signed integer and stores its binary value. The server truncates the number's fractional parts.
The number's range is from -2,147,483,648 to 2,147,483,647. If the number exceeds the range, the server fails the operation and reports an error.
See |
|
|
|
|
|
This type is identified by
The server converts a number to a 64-bit signed integer and stores its binary value. The server truncates the number's fractional parts.
The number's range is from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. If the number exceeds the range, the server fails the operation and reports an error.
See |
|
|
|
|
|
This type is identified by
The server converts a number to a 32 digit BCD number. It’s a precise floating point number (given the maximum number of significant digits)
|
|
|
|
|
|
This type is identified by
The server converts a number to a IEEE 16-bit floating point number and stores its binary value, which is a lossy, base-two format. Using this format will introduce base-ten to base-two conversion issues and will likely reduce the number's precision.
See
|
|
|
|
|
|
This type is identified by
The server converts a number to a IEEE 32-bit floating point number and stores its binary value, which is a lossy, base-two format. Using this format will introduce base-ten to base-two conversion issues and may reduce the number's precision.
See
|
|
|
|
|
XML in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as XML.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
HTML in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as HTML.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
JavaScript in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as JavaScript.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
|
SQL in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as SQL.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
CSS in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as CSS.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
CSV in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as CSV.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
Markdown in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as Markdown.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
RTF in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as RTF.
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
|
TSV in a minimal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as tab-separated values (TSV).
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
Turtle in a minimal variant object:
Turtle in a maximal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as Turtle (Terse RDF Triple Language).
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
vCard in a minimal variant object:
vCard in a maximal variant object:
|
This type is identified by
The server requires and validates that the value is encoded as UTF-8. It does not validate it as vCard
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
MP4 in a minimal variant object:
MP4 in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as an MP4 video.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
QuickTime in a minimal variant object:
QuickTime in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as QuickTime video.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
BMP in a minimal variant object:
BMP in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a BMP image.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
GIF in a minimal variant object:
GIF in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a GIF image.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
JPEG in a minimal variant object:
JPEG in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a JPEG image.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
SVG in a minimal variant object:
SVG in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a SVG image.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
PNG in a minimal variant object:
PNG in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a PNG image.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
FLAC in a minimal variant object:
FLAC in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a FLAC audio recording.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
FLAC in a minimal variant object:
FLAC in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a FLAC audio recording.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
OPUS in a minimal variant object:
OPUS in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as an OPUS audio recording.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
(It is currently named
|
|
|
|
MIDI in a minimal variant object:
MIDI in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as a Standard MIDI file for music playback and notation.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
(It is currently named
|
|
|
|
SP-MIDI in a minimal variant object:
SP-MIDI in a maximal variant object:
|
This type is identified by "type": "spMidi" and
The server stores the binary value AS IS. It does not validate it as a Scalable Playback MIDI (SP-MIDI) file for music playback and notation.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |
|
|
|
|
|
OTF in a minimal variant object:
OTF in a maximal variant object:
|
This type is identified by
The server stores the binary value AS IS. It does not validate it as an Open Type Font (OTF) file.
A variant object must include the
FairCom's SQL, ISAM, CTDB, and JSON DB APIs receive, store, and return the value AS IS. |