> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Create a data request in Postman

Use Postman's data client to connect to a data source and query it directly. You can connect to a database, such as PostgreSQL or MySQL, or to a local or remote file. You can then explore the source's structure and run queries against it without leaving Postman.

Data requests are available in the Postman desktop app, and in the web app with the [Postman Desktop Agent](/docs/getting-started/basics/about-postman-agent/) active. Connecting to a local file is available only in the desktop app.

## Connect to a data source

1. In the sidebar, click <img alt="Add icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/action-add-stroke.svg#icon" width="20px" /> and select **Data**.

2. Click the address bar and select the type of data source you want to connect to:

   * For **Local file**, choose the file from your computer.
   * For **Remote file**, enter the file's URL.
   * For **MySQL** or **PostgreSQL**, enter a connection string. For example, `<scheme>://<username>:<password>@<host>:<port>/<database>`, where `<scheme>` is the database type such as `postgresql` or `mysql`. Postman flags any fields that are missing or incorrectly formatted.

3. (Optional) For a database, you can enter the username and password in the **Authorization** tab instead of including them in the connection string.

## Query a data source

1. In the schema explorer on the left side of the **Query** tab, browse and search the data source's structure, such as its tables and columns.

2. Build your query. You can select an item in the schema explorer to add it to the query, or enter your query in the editor on the right side of the **Query** tab. The editor provides autocomplete, error highlighting, and formatting for SQL, including when you query a CSV as if it were a SQL table.

3. (Optional) To prevent the request from running SQL that writes data or changes the schema, such as `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `ALTER`, or `DROP`, open the **Settings** tab and turn on **Read-only**.

4. Click **Run** to run the query. The results display in a table on the **View** tab, where you can sort, search, and page through the returned data. Postman also shows the number of rows returned and how long the query took.

   You can keep multiple queries in the editor, separated by new lines or semicolons. Postman runs only the query where your cursor is focused, one at a time.

5. (Optional) Click **Save** to save the data request to a collection so you can reuse it later.