CommandsDatabases

Databases

Provision, configure, and manage databases with the Skytells CLI.

Skytells provides managed database instances directly from the CLI. Supported engines are PostgreSQL, MySQL, MariaDB, MongoDB, and Redis. All databases are provisioned within your project's network and can be linked to apps via environment variables.

Commands on this page

CommandDescription
skytells databases lsList databases in the linked project
skytells databases addProvision a new database
skytells databases inspectShow connection details and configuration
skytells databases setUpdate a database setting
skytells databases rmDelete a database
skytells databases startStart a stopped database
skytells databases stopStop a running database
skytells databases deployApply a pending configuration change

skytells databases ls

Lists all database instances in the linked project.

Syntax

skytells databases ls [--json]

Example

skytells databases ls
┌─────────┬──────────────┬────────────┬─────────┬──────────────────┐
│ ID      │ Name         │ Engine     │ Status  │ Version          │
├─────────┼──────────────┼────────────┼─────────┼──────────────────┤
│ db_001  │ main-db      │ PostgreSQL │ running │ 17               │
│ db_002  │ cache        │ Redis      │ running │ 7.4              │
└─────────┴──────────────┴────────────┴─────────┴──────────────────┘

skytells databases add

Provisions a new managed database instance.

Syntax

skytells databases add <name> <type> [--version <v>] [--username <u>] [--password <p>] [--port <n>] [--json]

Arguments

ArgumentDescription
nameName for the database instance.
typeEngine type. See supported values below.

Supported engines

type valueDescription
postgresqlPostgreSQL relational database
mysqlMySQL relational database
mariadbMariaDB (MySQL-compatible)
mongodbMongoDB document database
redisRedis in-memory data store

Flags

FlagDescription
--version <v>Engine version. Defaults to the latest stable version.
--username <u>Initial database username. Defaults to admin.
--password <p>Initial database password. Omit to auto-generate.
--port <n>Port number. Defaults to the engine's standard port.
--jsonOutput the created database as JSON.

Examples

# PostgreSQL (default latest version)
skytells databases add main-db postgresql

# PostgreSQL 17, specific credentials
skytells databases add main-db postgresql --version 17 --username appuser --port 5432

# Redis cache
skytells databases add cache redis --version 7.4

# MongoDB
skytells databases add sessions mongodb --version 7

# MySQL
skytells databases add users-db mysql --version 8

# Capture connection info
DB=$(skytells databases add main-db postgresql --json)
echo "Host: $(echo $DB | jq -r '.host')"
echo "Port: $(echo $DB | jq -r '.port')"

skytells databases inspect

Returns detailed connection details, configuration, and current status for a database.

Syntax

skytells databases inspect <id> [--json]

Example

skytells databases inspect db_001

# Extract connection string
skytells databases inspect db_001 --json | jq -r '.connection_string'

skytells databases set

Updates a configurable field on a database. Some fields require a skytells databases deploy to take effect.

Syntax

skytells databases set <id> <field> <value> [--json]

Allowed fields

FieldDescription
nameDatabase display name
passwordUpdate the database password
versionTarget engine version (requires deploy to apply)

Examples

skytells databases set db_001 name "prod-database"
skytells databases set db_001 password "new-secure-password"

skytells databases rm

Permanently deletes a database and all its data.

Syntax

skytells databases rm <id> [-f] [--json]
FlagDescription
-fSkip the confirmation prompt.

Lifecycle commands

skytells databases start

Starts a stopped database. The database resumes from its last persisted state.

skytells databases start <id> [--json]

skytells databases stop

Stops a running database. Data is preserved; the database is taken offline.

skytells databases stop <id> [-f] [--json]
FlagDescription
-fForce stop without confirmation.

skytells databases deploy

Applies pending configuration changes (such as a version upgrade) to the database instance.

skytells databases deploy <id> [--json]

Connect an app to a database

# Inspect the database to get connection details
DB=$(skytells databases inspect db_001 --json)
CONN_STR=$(echo $DB | jq -r '.connection_string')

# Inject into app environment
skytells env set DATABASE_URL="$CONN_STR" --app app_abc123

# Restart the app to pick up the new variable
skytells apps restart app_abc123

How is this guide?

On this page