Support standard PostgreSQL environment variables in postgresAdapter #13505
vprasanth
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
The
postgresAdapter
should support standard PostgreSQL environment variables (PGUSER
,PGHOST
,PGPASSWORD
,PGDATABASE
,PGPORT
) to improve developer experience and compatibility with existing PostgreSQL tooling.Problem Statement
Currently, the
postgresAdapter
requires either:DATABASE_URI
orPOSTGRES_URL
This creates friction when working with:
psql
,pg_dump
,pg_restore
)Current Workaround
Developers must either:
Proposed Solution
The
postgresAdapter
should automatically detect and use standard PostgreSQL environment variables when no explicit configuration is provided:Environment Variables to Support
PGHOST
- Database host (default: localhost)PGPORT
- Database port (default: 5432)PGDATABASE
- Database namePGUSER
- Database usernamePGPASSWORD
- Database passwordPGSSLMODE
- SSL mode configurationPriority Order
DATABASE_URI
/POSTGRES_URL
)Benefits
psql
,pg_dump
, and PayloadImplementation Notes
This could leverage the existing
pg
library's built-in support for these environment variables, or implement similar logic in the adapter initialization.Example Use Cases
Docker Compose
Deployment Platforms
Many platforms (Railway, Render, etc.) automatically provide these standard variables.
Development Workflow
Related Issues
Environment:
Beta Was this translation helpful? Give feedback.
All reactions