openverse
openverse copied to clipboard
Add `psql` and `pgcli` to `ov` tooling
Description
We recently encountered a case where it would be useful to have psql and pgcli available in the ov environment for interacting with the stack. It seems like the perfect candidate to add to the list of tooling available in ov!
We'll need to touch the following places for this:
- Adding whatever's necessary to install for the
psqlutility andpipxto the Docker image
https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L49-L58
- Adding
psql(or the dependency involved) to the list of dependency explanations
https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L27
- Adding
pgclito the list ofpipxdependencies:
https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L38
- Adding documentation for it to the included tools
https://github.com/WordPress/openverse/blob/90f87b8712b50cf05401de91eb5805b067efeb85/documentation/general/general_setup.md#L111-L115
Additional context
Initially came up here: https://github.com/WordPress/openverse/pull/4610#pullrequestreview-2187062900
Would pgcli be a better alternative? It might also be easier to install via pipx.
Yea that works! We'll still need to have the libraries required for psql, per the install documentation:
Pgcli uses psycopg to talk to postgres database. In order to install psycopg, you will need libpq and python-dev installed on your system. Since psycopg is a C extension for Python, a C compiler is needed to install it on your system.
This seems simple enough to do, I can work on this. (New here ehehe)
Welcome @vivek378521! I've assigned this to you.
Created a PR: https://github.com/WordPress/openverse/pull/4664
For starting the psql server there are additional steps though, so might need to keep that in mind: https://developer.fedoraproject.org/tech/database/postgresql/about.html