npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

multi-dbman-cli

v0.1.8

Published

Multi-DB manager CLI (Postgres, MySQL, MongoDB)

Readme

DBMAN CLI — Multi‑Database Manager CLI

dbman is a CLI tool to manage multiple databases from a single interface. It supports Postgres, MySQL, and MongoDB for connection management and adds convenient SQL helpers for common operations.


Features

  • Manage connections for Postgres, MySQL, MongoDB

  • Test connections with one command

  • Run arbitrary SQL (query) on Postgres/MySQL

    • create-db, drop-db
    • create-table, drop-table
    • select, insert, update, delete-row

Installation

npm i -g multi-dbman-cli

Quick Start (Step‑by‑Step)

1) Add a connection

dbman config

Follow the prompts to name your connection and choose the DB type. Values are saved into the nearest .dbman.yaml.

2) List connections

dbman list

Shows all known connections (from project/user config).

┌─────────┬──────────────┬────────────┬─────────────┬──────┬────────────┬──────────────┬─────────────────────────────┬────────┐
│ (index) │ name         │ type       │ host        │ port │ user       │ database     │ uri                         │ dbName │
├─────────┼──────────────┼────────────┼─────────────┼──────┼────────────┼──────────────┼─────────────────────────────┼────────┤
│ 0       │ 'mypg'       │ 'postgres' │ 'localhost' │ 5432 │ 'postgres' │ 'appdb'      │                             │        │
│ 1       │ 'mymysql'    │ 'mysql'    │ 'localhost' │ 3306 │ 'root'     │ 'appdb'      │                             │        │
│ 2       │ 'test-pg'    │ 'postgres' │ 'localhost' │ 5432 │ 'postgres' │ 'testpg_db'  │                             │        │
│ 3       │ 'test-mysql' │ 'mysql'    │ 'localhost' │ 3306 │ 'root'     │ 'testsql_db' │                             │        │
│ 4       │ 'mymongo'    │ 'mongo'    │             │      │            │              │ 'mongodb://localhost:27017' │ 'test' │
└─────────┴──────────────┴────────────┴─────────────┴──────┴────────────┴──────────────┴─────────────────────────────┴────────┘

3) Test a connection

# Test a specific one
dbman test -d mypg

✅ mymongo (mongo) OK

4) Check DB servers (doctor)

# Check all configured DB connections
dbman doctor

Verify that your configured database servers are running. If a server is not reachable, doctor shows OS-specific installation and startup instructions. Works for Postgres, MySQL, and MongoDB.

| Connection | Type | Status | Details / Fix | |-------------|-----------|---------|---------------| | mypg | postgres | ❌ | Cannot connect to postgres at localhost:5432. Run: sudo apt update && sudo apt install postgresql && sudo systemctl start postgresql | | mymysql | mysql | ✅ | mysql is running at localhost:3306 | | test-pg | postgres | ❌ | Cannot connect to postgres at localhost:5432. Run: sudo apt update && sudo apt install postgresql && sudo systemctl start postgresql | | test-mysql | mysql | ✅ | mysql is running at localhost:3306 | | mymongo | mongo | ✅ | MongoDB is running at mongodb://localhost:27017 |

5) Create a database (Postgres/MySQL)

You must connect to a server-level database that allows creating others (e.g., postgres on Postgres, or any DB on MySQL with permissions).

dbman create-db appdb -d mypg

6) Create a table (Postgres/MySQL)

Provide columns as name:TYPE. The tool uppercases the type for convenience.

# Postgres example
dbman create-table users -d mypg -c "id:SERIAL PRIMARY KEY" -c "name:TEXT" -c "age:INT" -c "email:VARCHAR(255)"

# MySQL example
dbman create-table products -d mymysql -c "id:INT PRIMARY KEY AUTO_INCREMENT" -c "name:VARCHAR(255)" -c "price:DECIMAL(10,2)"

7) Insert rows (Postgres/MySQL)

Provide column=value pairs. Values are inserted as strings; most RDBMS will coerce types where possible.

dbman insert users -d mypg -v "name=Alice" "age=25" "[email protected]"

8) Select rows (Postgres/MySQL)

Use a simple WHERE expression (raw SQL).

# All rows
dbman select users -d mypg

# Filtered
dbman select users -d mypg -w "age >= 18"

9) Update rows (Postgres/MySQL)

dbman update users -d mypg -s "age=26" -s "[email protected]" -w "name='Alice'"

10) Delete rows (Postgres/MySQL)

dbman delete-row users -d mypg -w "age < 18"

11) Drop a table (Postgres/MySQL)

dbman drop-table users -d mypg

12) Drop a database (Postgres/MySQL)

dbman drop-db appdb -d mypg

13) Run arbitrary SQL (Postgres/MySQL)

# Against the default connection
dbman query -q "SELECT * FROM users ORDER BY id DESC;"

# Against a specific connection
dbman query -d mymysql -q "SELECT COUNT(*) AS c FROM products;"

# JSON output (only for `query`)
dbman query -d mymysql -q "SELECT * FROM products LIMIT 5;" --json

🐘 Postgres quick demo

dbman config             # create `mypg`

dbman test -d mypg

dbman create-db appdb -d mypg

# point `mypg` at `appdb` in .dbman.yaml, then:
dbman create-table users -d mypg -c "id:SERIAL PRIMARY KEY" -c "name:TEXT" -c "age:INT" -c "email:VARCHAR(255)"

dbman insert users -d mypg -v "name=Alice" "age=25" "[email protected]"

dbman select users -d mypg -w "age >= 18"

dbman update users -d mypg -s "age=26" -w "name='Alice'"

dbman delete-row users -d mypg -w "age < 18"

🐬 MySQL quick demo

dbman config             # create `mymysql`

dbman test -d mymysql

dbman create-db shopdb -d mymysql

# point `mymysql` at `shopdb` in .dbman.yaml, then:
dbman create-table products -d mymysql -c "id:INT PRIMARY KEY AUTO_INCREMENT" -c "name:VARCHAR(255)" -c "price:DECIMAL(10,2)"

dbman insert products -d mymysql -v "name=Keyboard" "price=39.90"

dbman select products -d mymysql

🍃 MongoDB note (DBMAN CLI)

  • You can configure and test MongoDB connections using dbman config and dbman test.

List collections

dbman mongo-list-collections -d mymongo

Insert a document (creates collection if not exists)

dbman mongo-insert <collection-name> -d mymongo "name=Mg Mg" "age=25" "[email protected]"

Update a document

dbman mongo-update <collection-name> -d mymongo -s "age=26" -w '{"name":"Alice"}'

Find documents

dbman mongo-find <collection-name> -d mymongo -w '{"age":{"$gte":18}}'

Delete a document

dbman mongo-delete <collection-name> -d mymongo -w '{"name":"Alice"}'

Drop a collection

dbman mongo-drop-collection <collection-name> -d mymongo

🔧 Uninstall

npm uninstall -g multi-dbman-cli