# rarchdb A small read only database Mainly to be used by retroarch # Usage To convert a dat file use `dat_converter ` To list out the content of a db `rarchdb_tool list` To create an index `rarchdb_tool create-index ` To find an entry with an index `rarchdb_tool find ` The util `mkdb.sh ` will create a db file with indexes for crc sha1 and md5 # lua converters In order to write you own converter you must have a lua file that implements the following functions: ~~~.lua -- this function gets called before the db is created and shuold validate the -- arguments and set up the ground for db insertion function init(...) local args = {...} local script_name = args[1] end -- this is in iterator function. It is called before each insert. -- the function should return a table for insertion or nil when there are no -- more records to insert. function get_value() return { key = "value", -- will be saved as string num = 3, -- will be saved as int bin = binary("some string"), -- will be saved as binary unum = uint(3), -- will be saved as uint some_bool = true, -- will be saved as bool } end ~~~