From 957472a7a74c32682dedb6b99964759eb2d490b6 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 | 3 ++- src/PostgREST/CLI.hs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 931b6b2a1..fd6bccda8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - - #3093, Nested empty embeds no longer show empty values and are correctly omitted - @laurenceisla + - #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 ### Changed 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