Skip to main content

infrahub db

Manage the graph in the database.

Usage:

$ infrahub db [OPTIONS] COMMAND [ARGS]...

Options:

  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • constraint: Manage Database Constraints
  • index: Manage Database Indexes
  • init: Erase the content of the database and...
  • load-test-data: Load test data into the database from the...
  • migrate: Check the current format of the internal...
  • update-core-schema: Check the current format of the internal...

infrahub db constraint

Manage Database Constraints

Usage:

$ infrahub db constraint [OPTIONS] [ACTION]:[show|add|drop] [CONFIG_FILE]

Arguments:

  • [ACTION]:[show|add|drop]: [default: show]
  • [CONFIG_FILE]: [env var: INFRAHUB_CONFIG;default: infrahub.toml]

Options:

  • --help: Show this message and exit.

infrahub db index

Manage Database Indexes

Usage:

$ infrahub db index [OPTIONS] [ACTION]:[show|add|drop] [CONFIG_FILE]

Arguments:

  • [ACTION]:[show|add|drop]: [default: show]
  • [CONFIG_FILE]: [env var: INFRAHUB_CONFIG;default: infrahub.toml]

Options:

  • --help: Show this message and exit.

infrahub db init

Erase the content of the database and initialize it with the core schema.

Usage:

$ infrahub db init [OPTIONS]

Options:

  • --config-file TEXT: Location of the configuration file to use for Infrahub [env var: INFRAHUB_CONFIG; default: infrahub.toml]
  • --help: Show this message and exit.

infrahub db load-test-data

Load test data into the database from the test_data directory.

Usage:

$ infrahub db load-test-data [OPTIONS]

Options:

  • --config-file TEXT: Location of the configuration file to use for Infrahub [env var: INFRAHUB_CONFIG; default: infrahub.toml]
  • --dataset TEXT: [default: dataset01]
  • --help: Show this message and exit.

infrahub db migrate

Check the current format of the internal graph and apply the necessary migrations

Usage:

$ infrahub db migrate [OPTIONS] [CONFIG_FILE]

Arguments:

  • [CONFIG_FILE]: [env var: INFRAHUB_CONFIG;default: infrahub.toml]

Options:

  • --check / --no-check: Check the state of the database without applying the migrations. [default: no-check]
  • --help: Show this message and exit.

infrahub db update-core-schema

Check the current format of the internal graph and apply the necessary migrations

Usage:

$ infrahub db update-core-schema [OPTIONS] [CONFIG_FILE]

Arguments:

  • [CONFIG_FILE]: [env var: INFRAHUB_CONFIG;default: infrahub.toml]

Options:

  • --debug / --no-debug: Enable advanced logging and troubleshooting [default: no-debug]
  • --help: Show this message and exit.