From d4f77d9dad05e1d83536599c70f81fafcc7abf6d Mon Sep 17 00:00:00 2001 From: Alexandre Macabies Date: Sun, 11 Feb 2024 19:04:25 +0100 Subject: [PATCH] Make flake dev shell more useful for sqlx. --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index 0263f3e..893af6e 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,10 @@ devShells.default = pkgs.mkShell { shellHook = '' echo 'To create a test DB, use: export DATABASE_URL=$(pg_tmp -w 0 -d /tmp/ircjournal-pg)' + echo 'To migrate to be able to use sqlx compile-time validation, use: sqlx migrate run --source ircjournal/migrations' ''; + SQLX_OFFLINE = 0; + DATABASE_URL = "postgresql:///test?host=%2Ftmp%2Fircjournal-pg"; RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; inputsFrom = with packages; [ ircjournal ]; buildInputs = with pkgs; [