nupaas db — NuPaaS Docs
CLI reference

nupaas db

platform db provisions and inspects managed database instances for your organization. Databases are organization-scoped rather than project-scoped: one database can back several projects.

Command name

platform db has four subcommands: list, create, credentials and delete. One engine is supported — postgres.

db list

Lists every database instance in the organization with its engine and current lifecycle status.

List databases
platform db list
platform db list --json
ParameterTypeDescription
--orgstringOrganization ID. Defaults to the organization in your config.
--jsonbooleanEmit raw JSON instead of a table. Default: false.

The table prints a shortened ID, name, engine type and status. Use --json when scripting: it returns the full identifier, which the other subcommands require.

db create

Provisions a new instance. Both flags are required, and --engine is validated client-side before the request is sent, so a typo fails immediately rather than after a round trip.

Create a database
platform db create --name orders --engine postgres
ParameterTypeDescription
--namestringRequired. Name for the new database instance.
--enginestringRequired. Must be postgres. Any other value is rejected.
--orgstringOrganization ID. Defaults to the organization in your config.

The command returns as soon as provisioning has been accepted, printing the new database ID and engine. Provisioning continues in the background; poll platform db list until the status shows the instance is ready before you point an application at it.

db credentials

Fetches the connection credentials for one instance. By default the command prints a single ready-to-use PostgreSQL connection string with sslmode=require.

Read connection credentials
platform db credentials --id db_01H8XK2M4Q
platform db credentials --id db_01H8XK2M4Q --json
ParameterTypeDescription
--idstringRequired. The database ID.
--jsonbooleanEmit host, port, username and password as JSON fields. Default: false.

With --json you get the four fields separately — host, port, username and password — which is the form to use when composing a connection string for a driver that does not accept URLs.

db delete

Marks an instance for deletion. The command prompts for confirmation first and defaults to no, so pressing enter cancels.

Delete a database
platform db delete --id db_01H8XK2M4Q
ParameterTypeDescription
--idstringRequired. The database ID to delete.