Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

fauna delete-database

Deletes a database.

Syntax

fauna delete-database <DBNAME> [--[no-]color ] [--endpoint <value>]
  [--environment <value>] [--secret <value>] [--timeout <value>]
  [--url <value>]

Description

The delete-database command deletes a database.

Delete a top-level database

To delete a top-level database using delete-database, you must use an authentication secret scoped to the account’s top-level context. You can create a top-level secret using the fauna cloud-login command.

Delete a child database

To delete a child database using delete-database, you must use an authentication secret scoped to the parent database.

Considerations

When you delete a database, its data becomes inaccessible and is asynchronously deleted. As part of the deletion process, Fauna recursively deletes:

  • Any keys scoped to the database.

  • The database’s child databases, including any nested databases.

Deleting a database with a large number of keys can exceed Transactional Write Ops throughput limits. This can cause throttling errors with a limit_exceeded error code and a 429 HTTP status code.

Deleting a database with a large number of child databases can cause timeout errors with a time_out error code and a 440 HTTP status code.

To avoid throttling or timeouts, incrementally delete all keys and child databases before deleting the database. See delete all keys and delete all child databases.

Arguments

Argument Description

<DBNAME>

The name of the database to delete.

Options

Option Description

--[no-]color

Enables or disables color formatting for the output. Color formatting is enabled by default if the terminal supports it (determined using chalk/supports-color). Use --no-color to disable.

--endpoint

Connection endpoint from .fauna-shell.

--environment

Environment to use, from a Fauna project.

--help

Help for create-database command.

--secret

Authentication secret. Overrides the secret in .fauna-shell.

Use a scoped key to interact with a child database using a parent database’s admin key.

For example, with a parent database’s admin key secret of fn123, you can access a child database by appending the child database name and role: fn123:childDB:admin.

--timeout

Connection timeout (milliseconds).

--url

Database URL. Overrides the URL in .fauna-shell.

Examples

Delete the childDB database:

fauna delete-database childDB

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!