Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and reorder parameters to catalog/pgcli recipe #2023

Merged
merged 2 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down
4 changes: 2 additions & 2 deletions catalog/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
########
Expand Down