pgcli
A reference page for the pgcli resource
The Pgcli resource reference. This resource installs pgcli 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.jsonc 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 install postgres and pgcli to your systemcodify applyOpen a new terminal window and start the database server with this command
brew services start postgresqlCreate a new database. Replace
mydb with your desired namecreatedb mydbConnect to the database using
pgcli and you're done!pgcli mydbOnce you're done using postgres, stop the service.
brew services stop postgresql