---
url: https://pencel.ai/docs/integrations/databases.md
description: >-
  Connect a PostgreSQL, SQLite or Redis database so you can ask Pencel questions
  about your business data in plain English.
---

# Databases

If your orders, customers or inventory live in a database, connect it and ask Pencel about them in plain English. Pencel writes the query, runs it and explains the answer. You don't need to know SQL.

## What Pencel can do with it

* "How many orders did we ship last week, and what was the average order value?"
* "Which customers haven't ordered in 90 days?"
* "Which products are below their reorder level?"
* "Turn this into a weekly sales summary." Then click **Save as workflow** on the reply to get it every Monday. See [Turn a request into a routine](https://pencel.ai/docs/guides/run-and-build.html).

## Which connection to use

| Connection | Use it for | What you enter | Can it change data? |
|---|---|---|---|
| **PostgreSQL** | A PostgreSQL database, on your network or hosted online | **Connection String**, for example `postgresql://user:password@host:5432/database` | No. It's read-only. |
| **SQLite** | A database file on your computer, such as an app export | **Database Path**, the full location of the file | Yes, with your approval |
| **Redis** | A Redis data store | **Redis URL**, for example `redis://localhost:6379` | Yes, with your approval |

## How to connect

1. Open **Settings ▸ Connections** and stay on the **Recommended** tab.
2. Find the database type and click **Install**.
3. Review what the connection needs and click **Grant All & Continue**.
4. Enter the connection string, file path or URL.
5. Click **Install & Connect**.

The card appears on the **Installed** tab. To check it, open its **⋯** menu and click **Test Connection**.

## What needs your approval

* **Questions run without asking.** Looking up data, listing tables and running read queries need no approval.
* **Changes ask first.** With SQLite and Redis, anything that adds, changes or deletes data shows you what it will do and waits for you. PostgreSQL can't change data at all.

## Good to know

* **Use a read-only login where you can.** Ask whoever runs your database for a user that can only read the tables Pencel needs.
* **Pencel connects from your computer.** The database has to be reachable from your machine, for example over your office network or VPN.
* **Your connection details are stored encrypted on your computer.** See [Data handling](https://pencel.ai/docs/privacy-and-security/data-handling.html).
* **Query results are used to answer you.** Rows Pencel reads are sent to your AI model as part of the request, so ask for summaries rather than whole tables of sensitive data.

## Disconnect or change what it can do

Go to **Settings ▸ Connections ▸ Installed** and open the card's **⋯** menu:

* **Manage Tools**: switch individual actions off everywhere, or choose which run without asking in chats and workflows under **Auto-Approval** (**None**, **All tools** or **Custom**). Click **Save changes**. Rooms keep their own approvals.
* **Edit**: change the connection string, path or URL.
* **Disconnect** stops it for now. **Remove** deletes it and its saved details.

## Related

* [Connect your accounts](https://pencel.ai/docs/guides/setting-up-connections.html)
* [Integrations](https://pencel.ai/docs/integrations/overview.html)
* [Custom connections](https://pencel.ai/docs/integrations/custom-servers.html)
