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
| Command | Description |
|---|---|
skytells databases ls | List databases in the linked project |
skytells databases add | Provision a new database |
skytells databases inspect | Show connection details and configuration |
skytells databases set | Update a database setting |
skytells databases rm | Delete a database |
skytells databases start | Start a stopped database |
skytells databases stop | Stop a running database |
skytells databases deploy | Apply 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
| Argument | Description |
|---|---|
name | Name for the database instance. |
type | Engine type. See supported values below. |
Supported engines
type value | Description |
|---|---|
postgresql | PostgreSQL relational database |
mysql | MySQL relational database |
mariadb | MariaDB (MySQL-compatible) |
mongodb | MongoDB document database |
redis | Redis in-memory data store |
Flags
| Flag | Description |
|---|---|
--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. |
--json | Output 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')"Store the connection details returned at creation time — this is the only time the generated password is shown in plain text. Use skytells env set to inject the connection string into your apps.
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
| Field | Description |
|---|---|
name | Database display name |
password | Update the database password |
version | Target 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]| Flag | Description |
|---|---|
-f | Skip the confirmation prompt. |
Database deletion is irreversible. All data, tables, indexes, and configuration are permanently removed. Take a backup before deleting.
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]| Flag | Description |
|---|---|
-f | Force 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_abc123How is this guide?