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.
You need Lua and LuaRocks installed on your system.
# 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
luarocks install lmdb_tree
# 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
-h, --help
: Display help message
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
- 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
- Lua 5.1 or higher
- lightningmdb Lua bindings
- Access to LMDB database files
MIT License