Skip to content

Commit f3a191b

Browse files
committed
Make flake dev shell more useful for sqlx.
1 parent f627faf commit f3a191b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flake.nix

+3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
devShells.default = pkgs.mkShell {
2828
shellHook = ''
2929
echo 'To create a test DB, use: export DATABASE_URL=$(pg_tmp -w 0 -d /tmp/ircjournal-pg)'
30+
echo 'To migrate to be able to use sqlx compile-time validation, use: sqlx migrate run --source ircjournal/migrations'
3031
'';
32+
SQLX_OFFLINE = 1;
33+
DATABASE_URL = "postgresql:///test?host=%2Ftmp%2Fircjournal-pg";
3134
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
3235
inputsFrom = with packages; [ ircjournal ];
3336
buildInputs = with pkgs; [

0 commit comments

Comments
 (0)