Skip to content

Commit 595b133

Browse files
committed
chore: rename option --dump-schema to --dump-schema-cache
1 parent 04a4d3c commit 595b133

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4848
### Changed
4949
- #3248, Modified some CLI options - @taimoorzaeem
5050
+ Replace ``-e`` and ``--example`` with ``--example-file``
51+
+ Rename option ``--dump-schema`` to ``--dump-schema-cache``
5152

5253
### Deprecated
5354

Diff for: docs/references/cli.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ Schema Cache
4343

4444
.. code:: bash
4545
46-
$ postgrest [--dump-schema] [FILENAME]
46+
$ postgrest [--dump-schema-cache] [FILENAME]
4747
4848
Here ``FILENAME`` is the path to configuration file.

Diff for: nix/tools/tests.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ let
119119
dumpSchema =
120120
checkedShellScript
121121
{
122-
name = "postgrest-dump-schema";
122+
name = "postgrest-dump-schema-cache";
123123
docs = "Dump the loaded schema's SchemaCache in JSON format.";
124124
workingDir = "/";
125125
withEnv = postgrest.env;
@@ -128,7 +128,7 @@ let
128128
''
129129
${withTools.withPg} -f test/spec/fixtures/load.sql \
130130
${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \
131-
postgrest --dump-schema
131+
postgrest --dump-schema-cache
132132
'';
133133

134134
coverage =

Diff for: src/PostgREST/CLI.hs

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ main CLI{cliCommand, cliPath} = do
4444
CmdDumpConfig -> do
4545
when configDbConfig $ AppState.reReadConfig True appState
4646
putStr . Config.toText =<< AppState.getConfig appState
47-
CmdDumpSchema -> putStrLn =<< dumpSchema appState
47+
CmdDumpSchemaCache -> putStrLn =<< dumpSchema appState
4848
CmdRun -> App.run appState)
4949

5050
-- | Dump SchemaCache schema to JSON
@@ -71,7 +71,7 @@ data CLI = CLI
7171
data Command
7272
= CmdRun
7373
| CmdDumpConfig
74-
| CmdDumpSchema
74+
| CmdDumpSchemaCache
7575

7676
data Example = ExampleFile | ExampleDb | ExampleEnv
7777

@@ -116,7 +116,7 @@ readCLIShowHelp =
116116
cliParser :: O.Parser CLI
117117
cliParser =
118118
CLI
119-
<$> (dumpConfigFlag <|> dumpSchemaFlag)
119+
<$> (dumpConfigFlag <|> dumpSchemaCacheFlag)
120120
<*> O.optional configFileOption
121121

122122
configFileOption =
@@ -129,9 +129,9 @@ readCLIShowHelp =
129129
O.long "dump-config"
130130
<> O.help "Dump loaded configuration and exit"
131131

132-
dumpSchemaFlag =
133-
O.flag CmdRun CmdDumpSchema $
134-
O.long "dump-schema"
132+
dumpSchemaCacheFlag =
133+
O.flag CmdRun CmdDumpSchemaCache $
134+
O.long "dump-schema-cache"
135135
<> O.help "Dump loaded schema as JSON and exit (for debugging, output structure is unstable)"
136136

137137
exampleConfig :: Example -> [Char]

Diff for: test/io/fixtures.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cli:
1717
- name: dump config
1818
args: ['--dump-config']
1919
- name: dump schema
20-
args: ['--dump-schema']
20+
args: ['--dump-schema-cache']
2121
use_defaultenv: true
2222
- name: no config
2323
# failures: config files

Diff for: test/io/test_cli.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ def test_invalid_openapi_mode(invalidopenapimodes, defaultenv):
261261
def test_schema_cache_snapshot(baseenv, key, snapshot_yaml):
262262
"Dump of schema cache should match snapshot."
263263

264-
schema_cache = yaml.load(cli(["--dump-schema"], env=baseenv), Loader=yaml.Loader)
264+
schema_cache = yaml.load(
265+
cli(["--dump-schema-cache"], env=baseenv), Loader=yaml.Loader
266+
)
265267
formatted = yaml.dump(
266268
schema_cache[key],
267269
encoding="utf8",

0 commit comments

Comments
 (0)