Filesystem adapter for waterlink/active_record
.
require
it in your code and set FSDB_PATH
in your ENV (either from the outside, like from the shell, or from the inside: ENV["FSDB_PATH"] = "/some/folder"
).
Example structure:
./
`--fsdb.lock /* locked on open */
`--fsdb/
`--metadata.lock
`--metadata /* db settings */
`--0_users.lock
`--0_users/ /* table in the form of id_name */
`--metadata.lock
`--metadata /* table settings (fields) */
`--0.lock
`--0 /* single table row */
Lockfiles are implemented using flock(2)
and are shared for reads and exclusive for writes.
Metadata contains information that cannot be inferred from the directory structure (currently nothing).
Contains the table's fields description.
Comma-separated list of colon-separated name/type tuples.
Example: name:string,age:int64
A row is represented by a single file named after the row's id. It contains the columns' encoded data.
Field = { Int64 | String }
Int64 = binary data
String = length Int64 + binary data