ndc-postgres-cli is used to configure a deployment of ndc-postgres. It is intended to be automatically downloaded and invoked via the Hasura CLI, as a plugin.
Create a configuration in a new directory using the following commands:
-
Initialize a configuration:
CONNECTION_URI='<postgres-connection-string>' cargo run --bin ndc-postgres-cli -- --context='<directory>' initialize
-
Update the configuration by introspecting the database:
CONNECTION_URI='<postgres-connection-string>' cargo run --bin ndc-postgres-cli -- --context='<directory>' update
An older configuration version (e.g. "v3") can be upgraded to a newer one using the upgrade
command.
cargo run --bin ndc-postgres-cli -- upgrade --dir-from <DIR_FROM> --dir-to <DIR_TO>
Native Operations can be listed, added, and deleted using ndc-postgres-cli:
$ CONNECTION_URI='<postgres-connection-string>' cargo run --bin ndc-postgres-cli -- --context='<directory>' native-operation --help
Commands on Native Operations
Usage: hasura-ndc-postgres native-operation <COMMAND>
Commands:
list List the existing Native Operations
create Create a new Native Operation from a SQL file
delete Delete an existing Native Operation from the configuration
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help