From 420933cebad2d0169279ae3adf2438278724e74a Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 7 Jul 2024 17:51:06 +0200 Subject: [PATCH] fix: Make --dump-schema work with in-database pgrst.db_schemas setting This needs to be loaded from in-database configuration first, otherwise the dump-schema output will be for the default (public) schema. --- CHANGELOG.md | 1 + src/PostgREST/CLI.hs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eb6f5f29..eb14632a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - #3093, Nested empty embeds no longer show empty values and are correctly omitted - @laurenceisla + - #3644, Make --dump-schema work with in-database pgrst.db_schemas setting - @wolfgangwalther ## [12.2.1] - 2024-06-27 diff --git a/src/PostgREST/CLI.hs b/src/PostgREST/CLI.hs index c4f18d547..c09e3b5f6 100644 --- a/src/PostgREST/CLI.hs +++ b/src/PostgREST/CLI.hs @@ -44,7 +44,9 @@ main CLI{cliCommand, cliPath} = do CmdDumpConfig -> do when configDbConfig $ AppState.reReadConfig True appState putStr . Config.toText =<< AppState.getConfig appState - CmdDumpSchema -> putStrLn =<< dumpSchema appState + CmdDumpSchema -> do + when configDbConfig $ AppState.reReadConfig True appState + putStrLn =<< dumpSchema appState CmdRun -> App.run appState) -- | Dump SchemaCache schema to JSON