db
db get
Show one database and what is inside it.
read onlyrepeatable
One instance in full: where it runs, which version it is, the roles that can log in and the databases inside it.
A connection string needs one of each, and db url is what assembles it.
Usage
outplane db get <DATABASE>Arguments
| Argument | Type | Description |
|---|---|---|
DATABASE | string | Database name or id. Required. |
Output
| Field | Type | Description |
|---|---|---|
id | string | |
name | string | |
status | string | Only active accepts connections. provisioning means the provider has not finished. One of provisioning, active, failed, deleting. |
version | string | PostgreSQL major version. |
region | string | Fixed at creation. |
size | string | null | The provider's compute unit, such as 0.25-1. Not a platform instance code. |
createdAt | string | null | RFC 3339, UTC. |
roles | array | Role names that can log in. |
databases | array | {name, owner}: the databases inside the instance. |
Examples
List the roles a script can connect as
outplane db get orders --json --fields roles,databases{
"databases": [
{
"name": "main",
"owner": "app"
}
],
"roles": [
"app"
]
}Wait until it accepts connections
outplane db get orders --json --fields status{
"status": "active"
}Show a database
outplane db get ordersWhat to Know
- roles and databases come from the provider and are named, not identified: a connection string is built from one of each.
- A database that is still provisioning has neither yet. That is reported as an empty list with the status explaining it, not as a failure.
- The provider's own project object is returned by the API and deliberately not reported: it is somebody else's shape and changes without notice.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of db.not_found, db.ambiguous, usage.missing_argument. Branch on that, or on the exit status. The message is prose and changes.