fauna create-database
Creates a database.
Syntax
fauna create-database <DBNAME> [--[no-]color ] [--endpoint <value>]
[--environment <value>] [--secret <value>] [--timeout <value>]
[--url <value>]
Description
The create-database
command creates a database with the provided
database name.
If command line options are omitted, Fauna uses the default configuration file options.
Create a top-level database
To create a top-level database using create-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.
Create a child database
To create a child database using create-database
, you must use an
authentication secret scoped to
the parent database.
Options
Option | Description |
---|---|
|
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
|
|
Connection endpoint from |
|
Environment to use, from a Fauna project. |
|
Help for |
|
Authentication secret. Overrides the
secret in 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 |
|
Connection timeout (milliseconds). |
|
Database URL. Overrides the URL in |
Examples
Create a top-level database
To create a top-level database named ECommerce
:
fauna create-database ECommerce
If you’re using a .fauna-project
file
and want to create a top-level database, add --environment=''
:
fauna create-database --environment='' <DATABASE_NAME>
To create a top-level database, you must use a secret scoped to the account’s
top-level context. To create this secret and use it by default, use the
fauna cloud-login
command.
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!