avi-perl / DB_Explorer

A command-line tool for exploring a database from the command-line.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DB Explorer

A bootstrapped command-line tool for exploring and working with a database from the command-line. Useful when interacting with a DB on a project without CLI tooling offered by its framework.

Features

  • SQLAlchemy: Powered by providing a SQLAlchemy engine.
  • Typer: Powered by the Typer library allowing for simple command definition.
    • Click: Typer is powered by the Click library which can be leveraged for additional CLI functionality.

This project is not ready, but its public because I need it 😉

Getting Started

Install

$ pip install -r requirements.txt

Settings

There are multiple options for settings

  1. Edit the settings.py file
  2. Create a .env file (recommended).
  3. Create environment variables.

Custom Commands

To define your own commands, create a file in the commands/ dir. Each file must have app = typer.Typer() which will be picked up as a sub command.

  • Sub-command name: Taken from file name.
  • Sub-command help text: Taken from the file's doc string.
  • Sub-command available commands: Commands registered to the app.

Use

  • Your best bet is (after installing) to run python main.py
  • See commands/example.py for an example of a custom command.

About

A command-line tool for exploring a database from the command-line.


Languages

Language:Python 100.0%