Skip to main content

Custom PostgreSQL

To configure a custom PostgreSQL instance for production deployment, you need to modify the Hasura environment variables in the values.yaml file. Add the variables listed below under the environment section of the Hasura configuration.

Environment Variables for Custom PostgreSQL

NameTypeDescriptionRequired
HASURA_GRAPHQL_METADATA_DATABASE_URLStringConnection string for the metadata database used by Hasura.Yes
HASURA_GRAPHQL_DATABASE_URLStringConnection string for the primary application database used by Hasura.Yes
  • Do not remove any variables already present under the hasura.environment section.
  • Simply add the variables listed above under the hasura.environment section.

Connection String Format

Hasura expects PostgreSQL connection strings to follow this structure:

postgres://<username>:<password>@<host>:<port>/<database>

Example:

postgres://admin:password123@db.example.com:5432/repoflow

Parameters Explained:

  • <username>: The username used to authenticate with the PostgreSQL server.
  • <password>: The password associated with the username.
  • <host>: The hostname or IP address of your PostgreSQL server.
  • <port>: The port on which your PostgreSQL server is running (default: 5432).
  • <database>: The name of the PostgreSQL database.

Ensure that the provided connection strings point to your custom PostgreSQL instance and have the correct credentials and database details.