Skip to content

Editing QKW config file

Ravi J edited this page Oct 17, 2020 · 8 revisions

QKW config file

The config file path can be retrieved using

qkw -cfgfile

and by default the databases and the config file is in /etc/qkw-data/, with the environment variable QKW_CONFIG pointing to it.

version_info: 1.0
docs: www.github.com/ravijanjam/wiki
cmd:
  search:
    db: /etc/qkw-data/mydata-1.db
    table: C0,C1,C2,C3
  insert:
    db: /etc/qkw-data/mydata-1.db
    table: C0
dir:
  search:
    db: /etc/qkw-data/mydata-2.db
    table: D0,D1,D2,D3
  insert:
    db: /etc/qkw-data/mydata-2.db
    table: D0

As you can see, C0,D0 are the insert tables for the types C and D respectively. A maximum of four databases could be added and with unlimited number of tables. For illustration, only 2 databases are considered here.

The insert table is the one actively edited whenever information is added. The rest of them are used for search, and retrieval. Also, note since D0,C0 are in both insert, and search so that the most recently added information becomes searchable.


Switch Config Files - Method 1

A temporary config file can also be provided via CLI switches which helps play with a new set of tables. This is a fixed-option, where the string setcfg is provided as it is.

Note that QKW_CONFIG environment variable is overridden when this switch is used. When not used the default one works.

qkw -setcfg <path/to/another/configfile> <OTHER-QKW-OPTION_SWITCHES>

Switch Config Files - Method 2

If you have more than one configuration, you can switch config files easily using qkw as follows

qkw -iC cfg.1:"export QKW_CONFIG=/path/to/cfg/cfg.1"
qkw -iC cfg.2:"export QKW_CONFIG=/path/to/cfg/cfg.2"
qkw -iC cfg.3:"export QKW_CONFIG=/path/to/cfg/cfg.3"

The configuration files could be easily swapped by using the bash macros [manual]

rfs cfg.1
rfs cfg.2