10000 GitHub - twilson63/lmdb_tree: A CLI tool to visualize LMDB database contents as a tree structure
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

twilson63/lmdb_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lmdb_tree

A CLI tool written in Lua that reads LMDB databases and outputs a tree view of the data where keys containing path fragments separated by '/' are displayed as a hierarchical tree structure.

Installation

Prerequisites

You need Lua and LuaRocks installed on your system.

Install from GitHub

# Clone the repository
git clone https://github.com/twilson63/lmdb_tree.git
cd lmdb_tree

# Install dependencies
luarocks install lightningmdb

# Make the script executable (if not already)
chmod +x lmdb_tree.lua

# Optionally, install via LuaRocks
luarocks make lmdb_tree-1.0-1.rockspec

Install via LuaRocks (once published)

luarocks install lmdb_tree

Usage

# Set up Lua path for lightningmdb
eval $(luarocks path)

# Run the tool
./lmdb_tree.lua /path/to/lmdb/database

or if installed via LuaRocks:

lmdb_tree /path/to/lmdb/database

Options

  • -h, --help: Display help message

Example

Given an LMDB database with the following key-value pairs:

users/john/name = "John Doe"
users/john/email = "john@example.com"
users/jane/name = "Jane Smith"
users/jane/email = "jane@example.com"
config/database/host = "localhost"
config/database/port = "5432"
config/app/name = "MyApp"

The output would be:

├── config
│   ├── app
│   │   └── name = MyApp
│   └── database
│       ├── host = localhost
│       └── port = 5432
└── users
    ├── jane
    │   ├── email = jane@example.com
    │   └── name = Jane Smith
    └── john
        ├── email = john@example.com
        └── name = John Doe

Features

  • Tree Visualization: Displays LMDB key-value pairs as a hierarchical tree
  • Path Parsing: Automatically splits keys on '/' to create tree structure
  • Sorted Output: Keys are sorted alphabetically at each level
  • Value Display: Shows values alongside leaf nodes
  • Error Handling: Graceful error handling for invalid databases or paths

Requirements

  • Lua 5.1 or higher
  • lightningmdb Lua bindings
  • Access to LMDB database files

License

MIT License

About

A CLI tool to visualize LMDB database contents as a tree structure

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0