Refdb

Refdb
Login

Refdb

RefDB

(note: this website is a fossil scm repository, learn more at fossil-scm.org)

... is a tool for storing a three level deep hierarchical key store in flat text files while being able to edit the data with a spreadsheet. The flat files generated by refdb are quite resistant to conflicts on branch and merge in source control tools such as Fossil or Git.

Motive

Storing configuration data, test control data and so forth can be very convenient in a spreadsheet but spreadsheets cannot be easily modified in parallel and branched and merged in tools like fossil or git.

Information

Installation

  1. Install chicken scheme from: www.call-cc.org
  2. Install the refdb egg: chicken-install refdb

Data format

Files with extension .dat contain the data for each sheet.

[column header]
rowlabel value

Configuration Options

Configs are kept in the settings.cfg file in each refdb directory.


# For the refdb "testrefdb" the settings file is found here: testrefdb/settings.cfg
 
# Toggle row/col ordering 
[setup]
record row
# record col

# Add any special gnumeric switches here
[gnumeric]
--geometry 100x100

Run refdb for quick help

Run refdb from the commandline to get quick help:
> refdb
Usage: refdb action params ...

Note: refdbdir is a path to the directory containg sheet-names.cfg

  import filename.gnumeric refdbdir     : Import a gnumeric file into a txt db directory
  export refdbdir filename.gnumeric     : Export a refdb to a gnumeric file
  edit   refdbdir                       : Edit a refdbdir using gnumeric.
  emacs  refdbdir                       : Edit a regdbdir using emacs
  export-orgfile refdbdir file.org      : Create org file from refdb dir
  import-orgfile file.org refdbdir      : Create refdb from org file (must follow conventions of export, not generic)
  ls refdbdir                           : List the keys for specified level 
  lookup refdbdir sheetname row col     : Look up a value in the text db   
  getrownames refdbdir sheetname        : Get a list of row titles
  getcolnames refdbdir sheetname        : Get a list of column titles
  getrow refdbdir sheetname rowname     : Get the column-value pairs for given row
  getcol refdbdir sheetname colname     : Get the row-value pairs for given column
  dump2sqlite3 refdbdir fname.db        : dump refdb to sqlite3
  dump2csv refdbdir sheetname [csvfile] : dump refdb sheet to csv
  set refdbdir sheetname row col val    : set value 

To export to other formats; first export to gnumeric then use ssconvert.

e.g. 

refdb export mydata mydata.gnumeric
ssconvert -T Gnumeric_html:html40 mydata.gnumeric mydata.html 
  
Part of the Megatest tool suite. Learn more at http://www.kiatoa.com/fossils/megatest

Version: 1.03