PeepDB-dev / peepdb

CLI tool and python library to inspect databases fast.
https://peepdb.dev/
GNU General Public License v3.0
59 stars 6 forks source link
cli database-management open-source python python3 sql

peepDB

peepDB is an open-source command-line tool and Python library designed for developers and database administrators who need a fast and efficient way to inspect their database tables without writing SQL queries. With support for MySQL, PostgreSQL, and MariaDB, peepDB is lightweight, secure, and incredibly easy to use.

πŸš€ Features

🎬 peepDB in Action

Here's a quick demonstration of peepDB:

peepDB Demo

πŸ–ΌοΈ peepDB stills

peepDB example 2

Note: The above image reflect the commands used in the official release (v0.1.3)

πŸ“¦ Installation

You can install peepDB directly from PyPI:

pip install peepdb

Requirements:

Note: If peepdb gives an error like "The term 'peepdb' is not recognized as the name of a cmdlet" remember to add the Python Scripts folder to your PATH in Windows.

System Dependencies

Before installing peepdb, ensure you have the following system dependencies:

sudo apt-get update
sudo apt-get install libmariadb3 libmariadb-dev

Verify the installation by running:

peepdb --version

πŸ› οΈ Usage

peepDB uses a command-based structure for easier and more intuitive use. Here are the main commands:

1. Save Your Database Connection Details

peepdb save <connection_name> --db-type [mysql/postgres/mariadb] --host <host> --user <user> --database <database>

You'll be prompted securely for the password.

2. List Saved Connections

peepdb list

3. View Tables

View all tables:

peepdb view <connection_name>

View a specific table:

peepdb view <connection_name> --table <table_name>

4. Pagination

Use pagination to handle large datasets:

peepdb view <connection_name> --table <table_name> --page <page_number> --page-size <rows_per_page>

5. Choose Output Format

Get output in JSON format:

peepdb view <connection_name> --format json

6. Remove Saved Connections

Remove a specific connection:

peepdb remove <connection_name>

Remove all connections:

peepdb remove-all

For more detailed usage information on any command, use the --help option:

peepdb <command> --help

πŸ‘¨β€πŸ’» For Developers

Please refer to our Contributing Guide for information on setting up the development environment, running tests, and contributing to peepDB.

πŸ”’ Security

peepDB implements several security measures to protect your database connection details:

  1. Local Storage: All connection details are stored locally on your machine, not on any remote servers.
  2. Encryption: Connection details are encrypted before being stored, using the cryptography library.
  3. Secure Password Input: Passwords are never shown in plain text and are input securely.

However, please note that while we strive to implement best security practices, peepDB's security has not been verified by a third party. Users should exercise caution and follow general security best practices when using any tool that handles sensitive information.

The encryption key is stored in your user directory (~/.peepdb/key.key). Keep this key safe and do not share it.

πŸ“œ License

Distributed under the GNU General Public License Version 3. See the LICENSE file for more details.

πŸ“š Documentation

For more detailed documentation, please visit our GitHub Pages.