db url
Print a connection string.
A connection string, printed on its own so it can go straight into a variable or an environment file. This is the only command that returns a password, and asking for it is the request to see it.
While the instance has one role and one database, neither has to be named. With a choice, this refuses and lists them rather than picking.
Usage
outplane db url <DATABASE> [flags]Arguments
| Argument | Type | Description |
|---|---|---|
DATABASE | string | Database name or id. Required. |
Flags
| Flag | Type | Description |
|---|---|---|
--role | string | Which login to build it for. Optional when there is only one. |
--database | string | Which database inside the instance. Optional when there is only one. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
url | string | Carries the role's password. |
role | string | |
database | string | |
db | string | The instance it belongs to. |
This command prints a bare value in every format, so it can be read straight into a variable. It has no JSON form.
Examples
The only role and database
outplane db url ordersRead the parts rather than the string
outplane db url orders --json --fields role,database,db{
"database": "main",
"db": "orders",
"role": "app"
}Name them when there is a choice
outplane db url orders --role app --database mainWhat to Know
- Text is the default even in a pipe, unlike most commands, so command substitution captures the string rather than an object. Pass --json for the object.
- --role and --database are optional only while there is exactly one of each. With a choice the command refuses and lists them rather than picking.
- The string is a credential and is never masked here: asking for it is the request to see it. It does not appear in any other command's output.
- Because the piped default is text, a failure is a sentence on stderr rather than a JSON envelope on stdout, and stdout stays empty. That is what keeps command substitution from capturing an error message. Pass --json when the envelope is wanted.
- To hand it to an application, capture it and pass it to
outplane env set, which takes a KEY=VALUE pair and can deploy afterwards.
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.role_required, db.database_required, usage.missing_argument. Branch on that, or on the exit status. The message is prose and changes.