> ## Documentation Index
> Fetch the complete documentation index at: https://thenile.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting to Postgres using PSQL

This guide will walk you through the steps to connect to Nile using PSQL.

1. Create a Nile's Postgres database through the UI or use one of your existing databases to follow along.

![PSQL-1](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-1.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=c0ffc9005b2f153d12ec89736f84dc00)

2. Once you are inside a specific database, click on the settings tab on the left and navigate to the connections screen

![PSQL-2](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-2.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=83d6573e2bcb6e0d85385d46e4d162eb)

3. Click on the Postgres icon to get the connection string

![PSQL-3](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-3.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=372af70ef91b7b9a3474454abda050bd)

4. Click "Generate credentials". Use this if you really want to simplify the access. If not, you can replace the username and password manually and use that through commandline.

![PSQL-4](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-4.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=17998645dad495f870aacefd5ca23870)

5. Copy the connection string and run it on the command line.

![PSQL-5](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-5.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=1b991ed404fdb5b5388b990a56cb4a05)

6. You can now use the full power of psql with Nile. You can take a look at all the tables and schemas using \dt

![PSQL-6](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-6.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=b6c7fc84e8061de0b914000e502a68e5)

7. Execute any queries to interact with the tables. For example, if you want to see the rows in tenants table, execute a select query on it

![PSQL-7](https://mintcdn.com/nile/ZhObK_CvFMgzM-yj/images/psql-7.png?fit=max\&auto=format\&n=ZhObK_CvFMgzM-yj\&q=85\&s=afc3bc46ec90082bdff2c6e1366c885b)

8. Have fun using PSQL!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.