How to connect a local Hasura instance with Postgres.app
I’ve just spent an unnecessary amount of time figuring out how to connect my locally running Hasura docker instance with the local postgres database started by Postgres.app. Therefore I’m sharing the solution here.
When adding a new data source in Hasura’s console:
Database URLas Data Source
- Enter the following inside the
USERNAMEwith your system user name. If you don’t know what it is, run the command
whoamiin the terminal app.
The part I got stuck with was replacing
localhost as the database
host.docker.internal, since that is what docker requires.
Luckily Hasura itself had this information buried in one of their
Maybe this saves somebody out there some time. ✌️