Movatterモバイル変換


[0]ホーム

URL:


pgcli

pgcli

We stand with Ukraine

Ukrainian people are fighting for their country. A lot of civilians, women and children, are suffering. Hundreds were killed and injured, and thousands were displaced.

This is an image from my home town, Kharkiv. This place is right in the old city center.

Kharkiv, Uspensky sobor

Picture by @fomenko_ph (Telegram).

Please consider donating or volunteering.

BlackLivesMatter

We value the diversity of our community. We strive to amplify the voices of the oppressed to eradicate racism and xenophobia. We ask our community to stand together in support of the Black community.

Pgcli is a command line interface for Postgres with auto-completion and syntaxhighlighting.

Screenshot of pgcli showing SQL output and auto-completion on table names

Quick Start

If you already know how to install python packages, then you can simply do:

$pipinstallpgcli

If you're on macOS you can install it via Homebrew. Just be aware that this willinstall postgresql if you don't already have it.

$brewinstallpgcli

If you're having trouble with the quick start, check theinstall page fordetailed instructions.

Usage

$pgcli--helpUsage:pgcli[OPTIONS][DBNAME][USERNAME]Options:-h,--hostTEXTHostaddressofthepostgresdatabase.-p,--portINTEGERPortnumberatwhichthepostgresinstanceislistening.-U,--usernameTEXTUsernametoconnecttothepostgresdatabase.-u,--userTEXTUsernametoconnecttothepostgresdatabase.-W,--passwordForcepasswordprompt.-w,--no-passwordNeverpromptforpassword.--single-connectionDonotuseaseparateconnectionforcompletions.-v,--versionVersionofpgcli.-d,--dbnameTEXTdatabasenametoconnectto.--pgclircPATHLocationofpgclircfile.-D,--dsnTEXTUseDSNconfiguredintothe[alias_dsn]sectionofpgclircfile.--list-dsnlistofDSNconfiguredintothe[alias_dsn]sectionofpgclircfile.--row-limitINTEGERSetthresholdforrowlimitprompt.Use0todisableprompt.--less-chattySkipintroonstartupandgoodbyeonexit.--promptTEXTPromptformat(Default:"\u@\h:\d> ").--prompt-dsnTEXTPromptformatforconnectionsusingDSNaliases(Default:"\u@\h:\d> ").-l,--listlistavailabledatabases,thenexit.--auto-vertical-outputAutomaticallyswitchtoverticaloutputmodeiftheresultiswiderthantheterminalwidth.--warn/--no-warnWarnbeforerunningadestructivequery.--helpShowthismessageandexit.

pgcli also supports many of the sameenvironment variables aspsql for login options (e.g.PGHOST,PGPORT,PGUSER,PGPASSWORD,PGDATABASE).

Examples

$pgclilocal_database$pgclipostgres://amjith:passw0rd@example.com:5432/app_db$pgcli-hlocalhost-p5432-Uamjithapp_db

note: While using@ or special symbol in password, do encode and quote it.

$pgcli'postgresql://amjith:%40postgres@localhost:5432/app_db'$pgcli-hlocalhost-Uamjith-W'@postgres'-dapp_db

Request

If you know how to debian package or RPM package for Python applicationsplease get intouch.

Categories

Blogroll

Social


[8]ページ先頭

©2009-2026 Movatter.jp