From b05ea14122298d2b00c4f00b28efa0c36091966f Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Tue, 7 Mar 2023 12:42:41 -0500 Subject: [PATCH] nix: add notices for postgrest-with-* commands (#2697) For knowing where to connect and how to get logs --- nix/tools/withTools.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index a52fa4807..7c7b2753e 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -13,9 +13,10 @@ let withTmpDb = { name, postgresql }: + let commandName = "postgrest-with-${name}"; in checkedShellScript { - name = "postgrest-with-${name}"; + name = commandName; docs = "Run the given command in a temporary database with ${name}"; args = [ @@ -83,6 +84,10 @@ let psql -v ON_ERROR_STOP=1 -f "$_arg_fixtures" >> "$setuplog" log "Done. Running command..." + + echo "${commandName}: You can connect with: psql 'postgres:///$PGDATABASE?host=$tmpdir/socket' -U $PGUSER" + echo "${commandName}: You can tail the logs with: tail -f $tmpdir/db.log" + ("$_arg_command" "''${_arg_leftovers[@]}") '';