Autoscaling Report: Production databases on Neon use 2.4x less compute and 50% less cost than if they were running on a provisioned platform.
/CLI/databases

Neon CLI command: databases

List, create, and delete databases in a Neon project

The databases command lists, creates, and deletes databases in a Neon project from the terminal. For information about databases in Neon, see Manage databases. If --project-id is omitted, the CLI resolves it from your context file, auto-selects when your account has only one project, and prompts otherwise.

Subcommands: create, delete, list

neon databases list

Lists databases. If you don't specify a branch ID or name with --branch, the command targets the project's default branch. This applies to all databases subcommands.

neon databases list [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon databases list --branch br-autumn-dust-190886
Output
┌────────┬────────────┬──────────────────────┐
│ Name   │ Owner Name │ Created At           │
├────────┼────────────┼──────────────────────┤
│ neondb │ daniel     │ 2023-06-19T18:27:19Z │
└────────┴────────────┴──────────────────────┘

neon databases create

Creates a database. If you don't specify --owner-name, the current user becomes the database owner.

neon databases create [options]
OptionDescriptionTypeDefaultRequired
--nameDatabase namestringYes
--owner-nameOwner namestringNo
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon databases create --name mynewdb --owner-name john
Output
┌─────────┬────────────┬──────────────────────┐
│ Name    │ Owner Name │ Created At           │
├─────────┼────────────┼──────────────────────┤
│ mynewdb │ john       │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘

neon databases delete

Deletes a database. The <database> is the database name.

neon databases delete <database> [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon databases delete mydb
Output
┌─────────┬────────────┬──────────────────────┐
│ Name    │ Owner Name │ Created At           │
├─────────┼────────────┼──────────────────────┤
│ mydb    │ daniel     │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘
Was this page helpful?
Edit on GitHub

On this page

Copy neon init command