Dump contents of database into file. File is set of "key":"value" pairs, one line per pair. Some characters ('\n', '"', '\') are escaped.
$ cd utils
$ cc -g -Wall -Wextra -pedantic -I.. tkvdb_dump.c ../tkvdb.c -o tkvdb-dump
Dump to dump.txt
using 1M transaction buffer:
$ ./tkvdb-dump -s 1000000 -o dump.txt database.tkv
Restore database from dump. Note it doesn't clean contents of existing database before inserting data.
$ cd utils
$ cc -g -Wall -Wextra -pedantic -I.. tkvdb_restore.c ../tkvdb.c -o tkvdb-restore
$ ./tkvdb-restore -i dump.txt new_database.tkv