TKRZW_DBM_UTIL(1)

πŸ“¦
version 1.0.32 Β· 3 versions
, in epel 10, fedora 43

πŸ‘‘ NAME πŸ‘‘

okay so bestie, meet tkrzw_dbm_util β€” this is the manual page for tkrzw_dbm_util version 1.0.32, and it lives in the User Commands section. it's giving "swiss army knife for Tkrzw databases" and I'm obsessed πŸ’…


✨ DESCRIPTION ✨

tkrzw_dbm_util: DBM utilities of Tkrzw periodt πŸ¦‹

πŸŽ€ Usage:

each of these is a whole subcommand, and the vibe is: you say what you want, then you hand it a file. here we go, no cap:

tkrzw_dbm_util create [common_options] [tuning_options] [options] file

: Creates a database file. 🌱

tkrzw_dbm_util inspect [common_options] file [attr]

: Prints inspection of a database file. πŸ”

tkrzw_dbm_util get [common_options] file key

: Gets a record and prints it. πŸ’Œ

tkrzw_dbm_util set [common_options] [options] file key

: Sets a record. ✍️

tkrzw_dbm_util remove [common_options] file key

: Removes a record. πŸ—‘οΈ

tkrzw_dbm_util rekey [common_options] file old_key new_key

: Changes the key of a record. πŸ”‘

tkrzw_dbm_util list [common_options] file

: Lists up records and prints them. πŸ“œ

tkrzw_dbm_util rebuild [common_options] [tuning_options] file

: Rebuilds a database file for optimization. πŸ› οΈ

tkrzw_dbm_util restore [common_options] old_file [new_file]

: Restores a broken database file. 🩹

tkrzw_dbm_util merge [common_options] dest_file src_files...

: Merges database files. 🫱🫲

tkrzw_dbm_util export [common_options] [options] dbm_file rec_file

: Exports records to a flat record file. πŸ“€

tkrzw_dbm_util import [common_options] [options] dbm_file rec_file

: Imports records from a flat record file. πŸ“₯


🌈 Common options:

these ones work basically everywhere, they're the group-chat regulars πŸ’–

  • --dbm impl β€” the name of a DBM implementation: auto, hash, tree, skip, tiny, baby, cache, stdhash, stdtree, poly, shard. (default: auto)
  • --file impl β€” the name of a file implementation: mmap-para, mmap-atom, pos-para, pos-atom. (default: mmap-para)
  • --no_wait β€” fails if the file is locked by another process. like, no waiting around, it just says no πŸ’€
  • --no_lock β€” omits file locking. πŸ™ˆ
  • --sync_hard β€” synchronizes the file physically when closing.
  • --alloc_init num β€” the initial allocation size. (default: 1048576)
  • --alloc_inc num β€” the allocation increment factor. (default: 2.0)
  • --block_size num β€” the block size of the positional access file. (default: 1)
  • --direct_io β€” enables the direct I/O option of the positional access file.
  • --sync_io β€” enables the synchronous I/O option of the positional access file.
  • --padding β€” enables padding at the end of the file.
  • --pagecache β€” enables the mini page cache in the process.
  • --multi β€” calls xxxMulti methods for get, set, and remove subcommands.

πŸ“ Options for the create subcommand:

  • --truncate β€” truncates an existing database file. > heads up bestie, "existing" is doing a lot of work in that sentence β€” it's cutting your current file down. know that before you type it πŸ™ˆ

πŸ” Options for the inspect subcommand:

  • --validate β€” validates records. βœ…

✍️ Options for the set subcommand:

  • --no_overwrite β€” fails if there's an existing record with the same key. no takebacks, no clobbering 🚫
  • --append str β€” appends the value at the end after the given delimiter.
  • --incr num β€” increments the value with the given initial value.
  • --reducer func β€” sets the reducer for the skip database: none, first, second, last, concat, concatnull, concattab, concatline, total. (default: none)

πŸ”‘ Options for the rekey subcommand:

  • --no_overwrite β€” fails if there's an existing record with the same key. same energy as above πŸ’…

πŸ“œ Options for the list subcommand:

  • --move type β€” type of movement: first, jump, jumplower, jumplowerinc, jumpupper, jumpupperinc. (default: first)
  • --jump_key str β€” specifies the jump key. (default: empty string)
  • --items num β€” the number of items to print. (default: 10)
  • --escape β€” C-style escape is applied to the TSV data.
  • --keys β€” prints keys only.

πŸ› οΈ Options for the rebuild subcommand:

  • --restore β€” skips broken records to restore a broken database. 🩹

🩹 Options for the restore subcommand:

  • --auto str β€” the restore mode automatically done: none, default, default-ns, sync, sync-ns. (default: none)
  • --end_offset β€” the exclusive end offset of records to read. (default: -1)
  • --class β€” the class name given to PolyDBM or ShardDBM.

🫱🫲 Options for the merge subcommand:

  • --reducer func β€” sets the reducer for the skip database: none, first, second, last, concat, concatnull, concattab, concatline, total. (default: none)

πŸ“€πŸ“₯ Options for the export and import subcommands:

  • --tsv β€” the record file is in TSV format instead of flat record.
  • --escape β€” C-style escape/unescape is applied to the TSV data.
  • --keys β€” exports keys only.
  • --ulog num β€” uses update logs based on the timestamp.
  • --ulog_ids num num β€” sets the server ID and the DBM index of update logs.

🌸 Tuning options for HashDBM:

  • --in_place β€” uses in-place rather than pre-defined ones.
  • --append β€” uses appending rather than pre-defined ones.
  • --record_crc num β€” the record CRC mode: -1, 0, 8, 16, 32. (default: 0 or -1)
  • --record_comp str β€” the record compression mode: default, none, zlib, zstd, lz4, lzma, rc4, aes. (default: none or default)
  • --offset_width num β€” the width to represent the offset of records. (default: 4 or -1)
  • --align_pow num β€” sets the power to align records. (default: 3 or -1)
  • --buckets num β€” sets the number of buckets for hashing. (default: 1048583 or -1)
  • --cipher_key str β€” sets the encryption key for cipher compressors. (default: empty)

πŸ¦‹ Tuning options for TreeDBM:

  • --in_place β€” uses in-place rather than pre-defined ones.
  • --append β€” uses appending rather than pre-defined ones.
  • --record_crc num β€” the record CRC mode: -1, 0, 8, 16, 32. (default: 0 or -1)
  • --record_comp str β€” the record compression mode: default, none, zlib, zstd, lz4, lzma, rc4, aes. (default: none or default)
  • --offset_width num β€” the width to represent the offset of records. (default: 4 or -1)
  • --align_pow num β€” sets the power to align records. (default: 10 or -1)
  • --buckets num β€” sets the number of buckets for hashing. (default: 131101 or -1)
  • --cipher_key str β€” sets the encryption key for cipher compressors. (default: empty)
  • --max_page_size num β€” sets the maximum size of a page. (default: 8130 or -1)
  • --max_branches num β€” sets the maximum number of branches of inner nodes. (default: 256 or -1)
  • --comparator func β€” sets the key comparator: lex, lexcase, dec, hex, real, float. (default: lex)

🧚 Tuning options for SkipDBM:

  • --offset_width num β€” the width to represent the offset of records. (default: 4)
  • --step_unit num β€” sets the step unit of the skip list. (default: 4)
  • --max_level num β€” sets the maximum level of the skip list. (default: 14)
  • --sort_mem_size num β€” sets the memory size used for sorting. (default: 268435456)
  • --insert_in_order β€” inserts records in ascending order of the key.

πŸ’œ Options for PolyDBM and ShardDBM:

  • --params str β€” sets the parameters in "key=value,key=value" format.

okay that's the whole page bestie, every single flag accounted for, nothing dropped, we ate and left no crumbs πŸ‘‘βœ¨

this has been tkrzw_dbm_util version 1.0.32, dated January 2025 β€” mwah, go forth and manage your databases, you main character πŸ«ΆπŸŒΈπŸ’…

πŸ“¦ where this page comes from