Skip to content

db: add Postgres support to db command#909

Open
SanHacks wants to merge 4 commits into
wardenenv:mainfrom
SanHacks:main
Open

db: add Postgres support to db command#909
SanHacks wants to merge 4 commits into
wardenenv:mainfrom
SanHacks:main

Conversation

@SanHacks

@SanHacks SanHacks commented Feb 4, 2026

Copy link
Copy Markdown

PR/Issue template (filled for this change)

Check List
[ ] Matching PR in the documentation repo (add link if/when created)
[ ] Entry in CHANGELOG.md

Is your feature request related to a problem? Please describe.
warden db currently assumes a MySQL/MariaDB container (MYSQL_* env vars) and can’t be used against environments that run Postgres.

Describe the solution you've submitted
Updated commands/db.cmd to detect whether the db service is Postgres (by checking for POSTGRES_* env vars) and route subcommands accordingly:
connect: uses psql for Postgres, mysql for MySQL/MariaDB
import: uses psql for Postgres, existing MySQL import pipeline remains unchanged
dump: uses pg_dump for Postgres, mysqldump for MySQL/MariaDB

Describe alternatives you've considered
Keeping separate commands (e.g. db-mysql / db-postgres) or adding a required flag to force DB type, but auto-detection keeps existing workflows unchanged.

Additional context
Tested locally by running warden db connect and warden db dump against both MySQL and Postgres-backed environments.

 Committer: Gundo Sifhufhi<sifhufhisg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant