ormdb-cli 0.1.0

Command-line interface for ORMDB
ormdb-cli-0.1.0 is not a library.

ormdb-cli

Crates.io Documentation License: MIT

Command-line interface for ORMDB.

Overview

ormdb-cli provides an interactive REPL and scripting interface for ORMDB. Features include:

  • Interactive REPL - Query and explore your database
  • Syntax Highlighting - Colored output for readability
  • History - Command history with search
  • Scripting - Execute query files
  • Table Output - Formatted table display

Installation

# Install from crates.io
cargo install ormdb-cli

# Or build from source
git clone https://github.com/Skelf-Research/ormdb.git
cd ormdb
cargo build --release -p ormdb-cli

Usage

Interactive Mode

# Connect to local server
ormdb

# Connect to specific server
ormdb --host localhost --port 5432

# Connect with URL
ormdb --url ormdb://localhost:5432/mydb

REPL Commands

ormdb> FETCH User WHERE id = 1 INCLUDE posts

┌────┬─────────┬─────────────────────┐
│ id │ name    │ email               │
├────┼─────────┼─────────────────────┤
│ 1  │ Alice   │ alice@example.com   │
└────┴─────────┴─────────────────────┘

ormdb> .tables          # List all entities
ormdb> .schema User     # Show entity schema
ormdb> .indexes User    # Show indexes
ormdb> .help            # Show help
ormdb> .quit            # Exit

Script Mode

# Execute a query file
ormdb --file queries.oql

# Execute inline query
ormdb --execute "FETCH User LIMIT 10"

# Output as JSON
ormdb --execute "FETCH User" --format json

Configuration

Configuration file: ~/.config/ormdb/config.toml

[connection]
default_url = "ormdb://localhost:5432"

[display]
format = "table"  # table, json, csv
color = true

[history]
max_entries = 1000

License

MIT License - see LICENSE for details.

Part of the ORMDB project.