pgcli
The Pgcli resource reference. This resource installs [pgcli] (https://www.pgcli.com) a command line REPL to manipulate postgres databases.
Parameters:
No parameters are currently available for the pgcli install
Example usage:
[ { "type": "pgcli" }]
Dependencies
This resource has a dependency on homebrew
. A working version of homebrew must be installed in order for this
resource to work. See the homebrew resource to see how to install it using
Codify. The dependency between the two resources will be automatically resolved and homebrew will be installed
first if both are specified in a config.
The pgcli tool also has a dependency on postgres
. The pgcli resources uses homebrew underneath and will
automatically install postgres if it’s not installed.
Setting up a local Postgres DB
- Create a
codify.json
file anywhere. - Open
codify.json
with your file editor and paste in the follow configs.
[ { "type": "homebrew", "formulae": [ "postgresql@14" ] }, { "type": "pgcli" }]
- Run
codify apply
in the directory of the file. And it should installpostgres
andpgcli
to your system
codify apply
- Open a new terminal window and start the database server with this command
brew services start postgresql
- Create a new database. Replace
mydb
with your desired name
createdb mydb
- Connect to the database using
pgcli
and you’re done!
pgcli mydb
- Once you’re done using postgres, stop the service.
brew services stop postgresql