This file describes the Evented::Database storage format.
There are 4 basic data types:
- string: a string.
- number: a float or integer.
- array: an ordered list of other data types.
- hash: a key:value dictionary.
All data is stored as strings; they must be encoded and parsed into the below formats.
Numbers are nothing more than numbers. No need to make it complicated.
1
46
3.5
0.5553
Strings are stored wrapped in double quotes. Any double quotes in itself should be escaped with the backslash character. Backslashes can be escaped as well.
"some simple string"
"a string with \"quotes\" in it"
"a string with a backslash (\\) in it"
List values are comma-separated value identifiers.
4,5,6,7
1,2,3,4,5,6
Hash pairs are comma-separated, in the form of key:value_identifier.
myKey:34,otherKey:37,someOtherkey:983
Evented::Database uses two databases: one for storing the location of values and one for the values themselves.
The location table (locations) stores the locations of values by using numerical identifiers. Each value has a unique identifier.
---------------------------------------------
| block | blockname | dkey | valueid |
--------------------------------------------
| block_type | block_name | key | value_id |
---------------------------------------------
- block_type: the string type of the block for named blocks; "section" for unnamed.
- block_name: the string name of the block.
- key: the string key this value represents.
- value_id: the identifier of the value in the value table.
The value table (dvalues) stores the actual values and their identifiers. It also stores the type of the value.
---------------------------------
| valueid | valuetype | value |
---------------------------------
| value_id | value_type | value |
---------------------------------
- value_id: the identifier of the value in the value table.
- value_type: the string type of the value as seen in "Data types" above.
- value: the value being stored in the syntax seen in "Storage syntax" above.