In most cases you will not need to access the database directly, choosing to interact with the data via the Graphql API, however, if you need direct access to postgres you can access it via the connection string.

Nhost Run

You can find details on how to connect to the database from an Nhost Run service here. If you don’t know the password you can set a new password in the dashboard:

Project Dashboard -> Settings -> Database

Public Access

For security reasons, by default your database won’t be accessible online. If you need to access it directly from the Internet, first you will need to enable public access (enabling public access will also show the connection details):

Project Dashboard -> Settings -> Database

Public access to your database utilizes pgbouncer. As this pooler is shared infrastructure the pooler will still be available even if your database has no public access configured. The pooler will simply not have access to your database.

Functions

Functions run on a separate network, which means in order to access the database you will first need to make it public.