DeployCLI Reference
eda db (Databases)
Provision and manage PostgreSQL and MariaDB/MySQL databases, connection strings, dumps, and backup snapshots
The eda db command group manages dedicated PostgreSQL and MariaDB / MySQL databases for your applications. It handles role creation, isolated database provisioning, connection string generation, SQL dumps, database seeding, and automated server backup schedules.
eda db <subcommand> [options]
explita deploy db <subcommand> [options]1. Subcommands Overview
| Command | Description |
|---|---|
eda db create [options] | Provision managed PostgreSQL or MySQL database (injects DATABASE_URL). |
eda db url [-a <appId>] [-k <key>] | View connection string (e.g. DATABASE_URL). |
eda db dump [-a <appId>] [-k <key>] [-f <file>] | Export SQL dump of database (stdout or output file). |
eda db restore [-a <appId>] [-k <key>] [-f <file>] | Restore database from an SQL dump (stdin or input file). |
eda db seed <file> [-a <appId>] [-k <key>] | Seed database from an SQL file. |
eda db backup schedule [options] | Configure automated daily backup schedule, retention count, and S3 sync. |
eda db backup ls [-a <appId>] [-k <key>] | List automated backup snapshots available on the server. |
eda db backup create [-a <appId>] [-k <key>] [--s3] | Trigger an immediate backup snapshot on the server. |
eda db backup restore <backupId> [options] | Restore database from a server backup snapshot archive. |
eda db backup rm <backupId> [options] | Delete a backup snapshot archive from the server. |
eda db rm [-a <appId>] [-k <key>] | Drop database and user credentials. |
2. Provision Database (eda db create)
Provision a managed database and automatically inject its credentials into your application environment:
eda db create [options]Options
| Flag | Shorthand | Type | Description | Default |
|---|---|---|---|---|
--app <appId> | -a | String | Target application ID (defaults to local explita.json). | Local project |
--type <type> | -t | String | Database engine: postgres or mysql. | postgres |
--key <key> | -k | String | Database key identifier (default: default, which injects DATABASE_URL). For a secondary database like analytics, injects ANALYTICS_DATABASE_URL. | default |
--name <name> | -n | String | Custom database name. | <app-name>_db |
--user <user> | -u | String | Custom database user role. | <app-name>_usr |
--pass <pass> | -p | String | Custom password (generates secure 32-char hex if omitted). | Auto-generated |
Examples
# Provision default PostgreSQL database (injects DATABASE_URL)
eda db create
# Provision MySQL / MariaDB database
eda db create -t mysql
# Provision secondary database (injects ANALYTICS_DATABASE_URL)
eda db create -k analytics -n analytics_db3. View Connection String (eda db url)
Inspect the generated connection string:
# View primary database URL
eda db url
# View secondary database URL
eda db url -k analytics4. SQL Dumps, Restores & Seeding
# Export SQL dump to stdout or pipe
eda db dump > backup.sql
# Export SQL dump to a specific file
eda db dump -f backup.sql
# Restore database from an SQL dump file
eda db restore -f backup.sql
# Seed database from a local seed script
eda db seed ./prisma/seed.sql5. Automated Backup Snapshots (eda db backup)
Configure automated retention schedules and manage server-side snapshot archives:
# Configure daily automated backups, keeping last 7 copies and replicating to S3
eda db backup schedule --daily --keep 7 --s3
# List automated backups stored on the server
eda db backup ls
# Trigger an immediate server-side backup snapshot
eda db backup create --s3
# Restore from a server backup snapshot ID
eda db backup restore bk_9f3a12_20261016
# Delete an old backup archive from the server
eda db backup rm bk_9f3a12_202610156. Delete Database (eda db rm)
Drop the database, terminate connections, and remove the user role:
eda db rm