diff --git a/api/justfile b/api/justfile index e40f2819201..c5e1afa77c3 100644 --- a/api/justfile +++ b/api/justfile @@ -79,8 +79,8 @@ stats media="images" host="localhost:50280": just _curl-get "{{ media }}/stats/" {{ host }} # Launch a `pgcli` shell in the web container -pgcli db_host="db" db_port="5432" db_name="openledger" db_user="deploy" db_password="deploy": up - env DC_USER="opener" just ../exec web pgcli postgresql://{{ db_user }}:{{ db_password }}@{{ db_host }}:{{ db_port }}/{{ db_name }} +pgcli db_user_pass="deploy" db_name="openledger": up + env DC_USER="opener" just ../_pgcli web {{ db_user_pass }} {{ db_name }} db ######################### # Django administration # diff --git a/catalog/justfile b/catalog/justfile index 4daf04650f2..9689c226759 100644 --- a/catalog/justfile +++ b/catalog/justfile @@ -85,8 +85,8 @@ ipython: up-deps bash -c \'ipython\' # Launch a `pgcli` shell in the PostgreSQL container -pgcli db_host="upstream_db" db_port="5432" db_name="openledger" db_user="airflow" db_password="airflow": up - just ../exec upstream_db pgcli postgresql://{{ db_user }}:{{ db_password }}@{{ db_host }}:{{ db_port }}/{{ db_name }} +pgcli db_user_pass="deploy" db_name="openledger": up + just ../_pgcli upstream_db {{ db_user_pass }} {{ db_name }} upstream_db ######### # Tests # diff --git a/justfile b/justfile index 098dbc10691..c516ed5b6d4 100644 --- a/justfile +++ b/justfile @@ -206,6 +206,10 @@ exec +args: run +args: just dc run -u {{ env_var_or_default("DC_USER", "root") }} {{ EXEC_DEFAULTS }} "{{ args }}" +# Execute pgcli against one of the database instances +_pgcli container db_user_pass db_name db_host db_port="5432": + just exec {{ container }} pgcli postgresql://{{ db_user_pass }}:{{ db_user_pass }}@{{ db_host }}:{{ db_port }}/{{ db_name }} + ######## # Misc # ########