Neon CLI commands ā databases
Use the Neon CLI to manage Neon directly from the terminal
Before you begin
- Before running the
databases
command, ensure that you have installed the Neon CLI. - If you have not authenticated with the neonctl auth command, running a Neon CLI command automatically launches the Neon CLI browser authentication process. Alternatively, you can specify a Neon API key using the
--api-key
option when running a command. See Connect.
For information about databases in Neon, see Manage databases.
databases
command
The Usage
The databases
command allows you to list, create, and delete databases in a Neon project.
list
This subcommand allows you to list databases.
Usage
Options
In addition to the Neon CLI global options, the list
subcommand supports these options:
Option | Description | Type | Required |
---|---|---|---|
--project-id | Project ID | string | Only if your Neon account has more than one project |
--branch | Branch ID or name | string |
If a branch ID or name is not provided, the command lists databases for the primary branch of the project.
Example
create
This subcommand allows you to create a database.
Usage
Options
In addition to the Neon CLI global options, the create
subcommand supports these options:
Option | Description | Type | Required |
---|---|---|---|
--project-id | Project ID | string | Only if your Neon account has more than one project |
--branch | Branch ID or name | string | |
--name | The name of the database | string | ā |
--owner-name | The name of the role that owns the database | string |
- If a branch ID or name is not provided, the command creates the database in the primary branch of the project.
- If the
--owner-name
option is not specified, the current user becomes the database owner.
Example
delete
This subcommand allows you to delete a database.
Usage
<database>
is the database name.
Options
In addition to the Neon CLI global options, the delete
subcommand supports these options:
Option | Description | Type | Required |
---|---|---|---|
--project-id | Project ID | string | Only if your Neon account has more than one project |
--branch | Branch ID or name | string |
If a branch ID or name is not provided, it is assumed the database resides in the primary branch of the project.
Example
Need help?
Send a request to support@neon.tech, or join the Neon community forum.