InfuseDB 0.2.0

InfuseDB is a Document oriented KV database
Documentation
  • Coverage
  • 0%
    0 out of 29 items documented0 out of 9 items with examples
  • Size
  • Source code size: 64.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.76 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Az107

InfuseDB

InfuseDB is a minimalist embedded database written in Rust. It’s designed to be simple, interactive, and easy to use from the command line or embedded in an app. It provides basic persistence and document-style querying (similar to JSON).


✨ Key Features

  • Store collections of documents.
  • Command-line navigation and editing.
  • Automatic persistence to disk via commit.
  • Support for nested keys (user.name, users.0.name, etc.).
  • Basic filtering with where and simple operators.
  • Optional TCP server mode (--features server).

πŸš€ Basic CLI Usage

Running the binary with no arguments opens an interactive REPL-style interface:

$ infusedb
InfuseDB 0.1.0
default>

General Commands (no collection selected)

help
    Show this help message.

exit
    Exit the application.

list
    List all available collections.

select <collection_name>
    Select a collection to work with.

new <collection_name>
    Create a new collection.

del_col <collection_name>
    Delete a collection. If a collection is currently selected, it will be deleted directly.

commit
    Save changes to the database.

Notes:
- You must select a collection to perform document operations.
- If no collection is selected, `list` will show all collections.

Commands (within a selected collection)

list
    List all documents in the current collection.

count
    Show how many documents are in the current collection.

get <key.path> [where <sub_key> <is|not is|gr|ls> <value>]
    Retrieve the value of a key. Supports nested keys via dot notation.

set <key.path> <value>
    Set the value of a key. Type is automatically inferred.

del <key.path>
    Delete a key from the current document.

name
    Show the name of the selected collection.

πŸ§ͺ Command Examples

new my_tasks
select my_tasks

set user.name "Juan"
set user.age 30
get user.name

get users.0.name where active is true
del user.age

commit
exit

βš™οΈ Running with Arguments

When passing command-line arguments, InfuseDB will execute commands directly and exit (non-interactive mode):

$ infusedb -p mydata.mdb -c tasks set task.name "Buy milk"

Common flags:

Flag Description
-p <path> Path to the .mdb file. Default: default.mdb
-c <name> Name of the collection. Default: default
-s (if built with --features server) start TCP server

πŸ”Œ Server Mode (optional)

If compiled with the server feature, InfuseDB can run as a TCP server:

cargo run --features server -- -s

This starts a listener on 0.0.0.0:1234. It's a starting point for remote command execution or a basic API.


πŸ“¦ Internal Structure

  • infusedb/: core database logic and types (DataType, InfuseDB, etc.)
  • command/: per-collection commands (get, set, etc.)
  • arg_parser/: minimalist CLI argument parser.
  • server/ (optional): embedded TCP server.
  • help_const.rs: CLI help text definitions.