Out Plane
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

ArgumentTypeDescription
DATABASEstringDatabase name or id. Required.

Output

FieldTypeDescription
idstring
namestring
statusstringOnly active accepts connections. provisioning means the provider has not finished. One of provisioning, active, failed, deleting.
versionstringPostgreSQL major version.
regionstringFixed at creation.
sizestring | nullThe provider's compute unit, such as 0.25-1. Not a platform instance code.
createdAtstring | nullRFC 3339, UTC.
rolesarrayRole names that can log in.
databasesarray{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 orders

What 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:

ExitKindMeaning
2usageInvalid arguments, unknown flag, or client-side validation failure.
3authNot authenticated, token revoked or expired, or forbidden for this team.
5not_foundThe named resource does not exist, or is not visible to this credential.
8upstreamThe 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.

On this page