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

add PGPARAMS to just for testing connections #1131

Merged
merged 1 commit into from
Jan 15, 2024
Merged
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
13 changes: 8 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set shell := ["bash", "-c"]

#export DATABASE_URL="postgres://postgres:postgres@localhost:5411/db"

export PGPORT := "5411"
export DATABASE_URL := "postgres://postgres:postgres@localhost:" + PGPORT + "/db"
# Set additional database connection parameters, e.g. just PGPARAMS='keepalives=0&keepalives_idle=15' psql
PGPARAMS := ""
PGPORT := "5411"

export DATABASE_URL := "postgres://postgres:postgres@localhost:" + PGPORT + "/db" + (if PGPARAMS != "" { "?" + PGPARAMS } else { "" })
export CARGO_TERM_COLOR := "always"

#export RUST_LOG := "debug"
Expand Down Expand Up @@ -38,11 +41,11 @@ debug-page *ARGS: start

# Run PSQL utility against the test database
psql *ARGS:
psql {{ ARGS }} {{ DATABASE_URL }}
psql {{ ARGS }} {{ quote(DATABASE_URL) }}

# Run pg_dump utility against the test database
pg_dump *ARGS:
pg_dump {{ ARGS }} {{ DATABASE_URL }}
pg_dump {{ ARGS }} {{ quote(DATABASE_URL) }}

# Perform cargo clean to delete all build files
clean: clean-test stop
Expand Down Expand Up @@ -268,7 +271,7 @@ git *ARGS: start

# Print the connection string for the test database
print-conn-str:
@echo {{ DATABASE_URL }}
@echo {{ quote(DATABASE_URL) }}

# Run cargo fmt and cargo clippy
lint: fmt clippy
Expand Down
Loading