Connecting to a database
Now, you can select a particular database that you want to work with. It should at least contain some tables(at least one) to work with. As we will perform reading records and other operations from pgcli.
pgcli <local_database_name> -U postgres
Here Postgres can be your user name(-U) which by default is postgres and the password is the master password for your postgres server on your system. The local database needs to be there in the postgres databases. I have selected the EMNS database in my local postgres server.
You also have multiple options to select and use in it like the
PGCLI: Python package for a interactive Postgres CLI
PGCLI is a Python package that is used as an interactive command-line interface for the PostgreSQL database server. For following with the article, make sure you have PostgreSQL installed and set up in your local system. You can follow the guide for Windows, Linux and macOS from the guide.
Also for performing any operations or testing out the package, create a simple database of your choice, There should be enough data for you to work with as it is just a REPL for running queries in a Postgres database.