FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, review the migration guide. Contact support@fauna.com with any questions.

delete-database

Delete a child database from the current database.

Syntax

fauna delete-database DBNAME [OPTIONS]

Description

The delete-database command deletes a child database. If you don’t pass any options at the command line, Fauna uses the default options in the fauna-shell configuration file.

This command deletes the database and all of its contents.

It is not possible to use this command to delete a parent or peer database. To delete a database outside of the current database, use the Fauna Dashboard.

Arguments

Argument Description

DBNAME

The name of the database to delete.

Options

Option Description

--domain=<domain>

Optional Fauna server domain, that is, the hostname where Fauna is running. Defaults to db.fauna.com.

--endpoint=<name>

Optional name of the endpoint to use for the command.

--port=<number>

Optional connection port. Defaults to 8443.

--scheme=<scheme>

Optional connection scheme. Must be one of https or http. Defaults to https.

--secret=<secret>

Optional secret to use. A secret authenticates your connection to Fauna, and connects you to a database.

--timeout=<integer>

Optional connection timeout, an integer number of milliseconds. When the interval has elapsed, fauna-shell stops waiting for a response and displays an error.

The default is zero, which means that fauna-shell waits until a response is received.

Examples

Assume that the current database has only one child database, my-test-db. To delete it, run:

$ fauna delete-database my-test-db
deleting database 'my-test-db'
database 'my-test-db' deleted

To verify that the database is deleted, run fauna shell and query the list of child databases and note that there are now none:

Connected to https://db.fauna.com:443
Type Ctrl+D or .exit to exit the shell
> Database.all()
{
  data: [
    {
      name: "production",
      coll: Database,
      ts: Time("2023-08-21T23:28:56.840Z"),
      global_id: "ywz5gew1syrre"
    },
    {
      name: "internal",
      coll: Database,
      ts: Time("2023-08-21T23:28:56.840Z"),
      global_id: "ywz5gew1syyre"
    }
  ]
}

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!