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.
platform db list
platform db list --json| Parameter | Type | Description |
|---|---|---|
| --org | string | Organization ID. Defaults to the organization in your config. |
| --json | boolean | Emit 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.
platform db create --name orders --engine postgres| Parameter | Type | Description |
|---|---|---|
| --name | string | Required. Name for the new database instance. |
| --engine | string | Required. Must be postgres. Any other value is rejected. |
| --org | string | Organization 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.
platform db credentials --id db_01H8XK2M4Q
platform db credentials --id db_01H8XK2M4Q --json| Parameter | Type | Description |
|---|---|---|
| --id | string | Required. The database ID. |
| --json | boolean | Emit 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.
platform db delete --id db_01H8XK2M4Q| Parameter | Type | Description |
|---|---|---|
| --id | string | Required. The database ID to delete. |