fauna database delete

fauna database delete --name <DB_NAME> [flags]

Delete a database.

Specify the child database’s name using --name. Use --database or --secret to specify the parent database. If using --secret, the parent database is the database to which the secret is scoped.

To delete a top-level database, specify a Region Group identifier in --database. You can’t create a top-level database using --secret.

Flags

Output
--color

Enable color formatting for output. Enabled by default. Use --no-color to disable.

--json

Output results as JSON.

--quiet

Suppress all log messages except fatal errors. Output only command results. Overrides --verbosity and --verbose-component.

Config
--config <string>

Path to a CLI config file to use. If provided, must specify a profile.

-p, --profile <string>

Profile from the CLI config file. A profile is a group of CLI settings.

Debug
--verbose-component <array>

Components to emit logs for. Overrides --verbosity.

Accepts the following values:

  • argv

  • config

  • creds

  • error

  • fetch

Pass values as a space-separated list. Example: --verbose-component argv config.

--verbosity <number>

Least critical log level to emit. Accepts integers ranging from 1 (fatal) to 5 (debug). Lower values represent more critical logs. Log messages with a level greater than this value are not logged.

API
-u, --user <string>

CLI user to run the command as. You must first log in as the user using fauna login. Defaults to default. See Interactive login.

--local

Use a local Fauna container.

If not otherwise specified, this flag sets:

Pass this flag with --database and an optional --role to create a scoped key that impersonates a built-in role on a child database.

--url <string>

URL for Core HTTP API requests made by the command. Defaults to https://db.fauna.com.

--secret <string>

Secret used for authentication. Supports scoped keys. The command runs in the database to which the secret is scoped. Can’t be used with --database or --role.

Can’t be used to delete a top-level database.

--account-key <string>

Fauna account key used for authentication. If used, you must also provide a --database and an optional --role. See Account key authentication.

Can’t be used with --user or --secret. If --account-key and --user are specified, --user is ignored.

-d, --database <string>

Database, including the Region Group identifier and hierarchy, to run the command in. Supports shorthand Region Group identifiers. Separate path components using /. Examples: us/my_db, eu/parent_db/child_db, global/db. Can’t be used with --secret.

If using a local Fauna container, omit the Region Group.

To delete a top-level database, only include the Region Group identifier.

-r, --role <string>

Role used to run the command. Defaults to admin. Can’t be used with --secret.

Options
-h, --help

Show help.

--version

Show the Fauna CLI version.

--name <string> (Required)

Name of the database to delete.

To delete a child database, specify the parent database using --database or --secret. If using --secret, the parent database is the database to which the secret is scoped.

Examples

# Delete the top-level 'my_db' database
# in the 'us' Region Group.
fauna database delete \
  --name my_db \
  --database us

# Delete the 'child_db' database directly
# under 'us/parent_db'.
fauna database delete \
  --name child_db \
  --database us/parent_db

# Delete a 'child_db' database directly under the
# database scoped to a secret.
fauna database delete \
  --name child_db \
  --secret my-secret

Aliases

fauna db delete

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!