Skip to main content
Version: v2.x

Connecting Hasura to an EnterpriseDB (BigAnimal) Postgres Database

Introduction

This guide explains how to connect a new or existing EnterpriseDB (BigAnimal) Postgres database to a Hasura instance, either on Hasura Cloud or self-hosted. If you're exploring EnterpriseDB Postgres and are interested in migrating an existing Postgres database - such as from Heroku - check out their docs before continuing below.

Note

If you plan on using Hasura Cloud, which we recommend, follow steps 1 and 2 below. If you're self-hosting a Hasura instance and already have a project running, skip to step 3.

Step 1: Sign up or log in to Hasura Cloud

Navigate to Hasura Cloud and sign up or log in.

Step 2: Create a Hasura Cloud project

On the Hasura Cloud dashboard, create a new project:

Create Hasura Cloud project

After the project is initialized successfully, click on Launch Console to open the Hasura Console in your browser.

On the Hasura Console, navigate to the Data tab and choose Connect Existing Database. Hasura will prompt you for a Postgres Database URL. We'll create this in the next step and then come back here.

Hasura Cloud database setup

Step 3: Create a BigAnimal Postgres DB on EnterpriseDB

Log into EnterpriseDB and head to your dashboard.

From your dashboard, scroll down and click Test drive for free in the BigAnimal section:

Test drive BigAnimal

EnterpriseDB will create a free trial and redirect you to your BigAnimal portal. From this portal, click Create New Cluster:

Create new cluster

Select the type of cluster and provider you plan to use, then click Next: Cluster Settings:

Choose type and provider

Enter a cluster name and password:

Add name and password

Choose a database type, region, and instance type:

Choose cluster type and region

Select your storage and networking requirements, then click Create Cluster:

Choose storage and networking

You'll be redirected to your BigAnimal portal and should see your cluster provisioning like this:

Cluster provisioning

Congratulations! You've now created a BigAnimal Postgres instance on EnterpriseDB which you can use with Hasura GraphQL Engine. Follow the steps below to connect it to Hasura.

Step 4: Get the database connection parameters and finish connecting the database

The structure of the database connection URL looks as follows:

postgresql://<user-name>:<password>@<host-server>:<port>/<database-name>

BigAnimal doesn't provide an out-of-the-box connection string matching the format above. Instead, we'll use the parameters from the Connect tab and pass them to Hasura.

After BigAnimal has provisioned the cluster, click on the title:

Cluster ready

From the cluster's dashboard, choose the Connect tab:

Cluster connection parameters

For each of the following under Connection Info, click Copy and paste their values into the appropriate fields on the Hasura Console:

BigAnimal parameterHasura parameter
DbnameDatabase Name
Read/Write HostHost
PortPort
UserUsername

Back on the Hasura Console, paste your values into the mapped field:

Connect to Hasura Console
Note

BigAnimal doesn't present your password on the Connect tab. You'll need to provide the password you used to create the cluster in Hasura's Password field.

Then click Connect Database.

Note

For security reasons, it is recommended to set database URLs as env vars and using the env vars to connect to the databases in place of the raw database URLs.

Voilà. You are ready to start developing.

Hasura Console

Next steps

Project actions
Note

For more information on which Postgres features we support, check out this page.