1.3.5 • Published 5 months ago

psql-shell v1.3.5

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
5 months ago

psql-shell

Enhanced postgres shell with better support for PowerShell and JSON.

npm Package Version

Features

  • Able to display all Chinese characters (unicode) in Windows PowerShell
  • Display aggregated result in prettified JSON format
  • Load database credential from .env or cli
  • support running SQL and Knex queries

npx cli

  • psql-shell
  • psql (alias)

Supported Commands

  • \l (list all databases)
  • \c database (connect to the database)
  • \d (list all tables)
  • \d+ (list each table name with row count)
  • \d table (show table schema)
  • \q (quit)
  • query; (run sql query)

Installation (optional)

npm i -g psql-shell

Usage

Usage with global install:

psql-shell

Usage without global install:

npx -y psql-shell

Database Credential

The connection credential, e.g. username, password, and database name are loaded in multiple places, including:

  • command line arguments
  • environment variables
  • .env file
  • ask from cli interactively

Name of arguments:

  • -d database name (-d is optional)
  • -U user name (-U is optional after database name)
  • -h database server host (default: localhost)
  • -P database server port (default: 5432)

(-W and -w are ignored)

Name of environment variables:

  • DB_NAME
  • DB_USER or DB_USERNAME
  • DB_PASS or DB_PASSWORD
  • DB_HOST or DB_HOSTNAME (default: localhost)
  • DB_PORT (default: 5432)

License

This project is licensed with BSD-2-Clause

This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:

  • The freedom to run the program as you wish, for any purpose
  • The freedom to study how the program works, and change it so it does your computing as you wish
  • The freedom to redistribute copies so you can help others
  • The freedom to distribute copies of your modified versions to others
1.3.5

5 months ago

1.3.4

6 months ago

1.3.3

7 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.2.2

8 months ago

1.3.0

8 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

0.0.0

11 months ago