> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-721-compare-sync.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SQLite

> Open and query SQLite database files directly, no server needed

SQLite is a file-based database engine. The whole database is one file on your Mac. The driver ships with TablePro, nothing to install.

## Quick Setup

Click **Create Connection...**, select **SQLite**, pick the database file with **Browse...**, and click **Save & Connect**. No host, port, or credentials.

Point the path at a file that does not exist and TablePro creates the database on connect.

TablePro registers as a handler for `.db`, `.db3`, `.s3db`, `.sl3`, `.sqlite`, `.sqlite3`, and `.sqlitedb` files, so double-clicking one in Finder opens it directly.

<Frame caption="SQLite connection form">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-feat-721-compare-sync/Px1jOVnHwSdgRuFN/images/sqlite-connection-form.png?fit=max&auto=format&n=Px1jOVnHwSdgRuFN&q=85&s=18f98b230605e9ba1d869c72ccf69237" alt="SQLite connection form with file path field" width="1560" height="960" data-path="images/sqlite-connection-form.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-feat-721-compare-sync/Px1jOVnHwSdgRuFN/images/sqlite-connection-form-dark.png?fit=max&auto=format&n=Px1jOVnHwSdgRuFN&q=85&s=4506f5e12b21d23a251f71a292e333ff" alt="SQLite connection form with file path field" width="1560" height="960" data-path="images/sqlite-connection-form-dark.png" />
</Frame>

## Common Locations

| Source         | Path                                                                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| Safari history | `~/Library/Safari/History.db`                                                                                |
| Photos         | `~/Pictures/Photos Library.photoslibrary/database/Photos.sqlite`                                             |
| Messages       | `~/Library/Messages/chat.db`                                                                                 |
| Rails          | `./db/development.sqlite3`                                                                                   |
| Django         | `./db.sqlite3`                                                                                               |
| iOS Simulator  | `~/Library/Developer/CoreSimulator/Devices/<device-id>/data/Containers/Data/Application/<app-id>/Documents/` |

<Warning>
  The Safari, Photos, and Messages databases sit in folders macOS protects. Grant TablePro Full Disk Access in **System Settings > Privacy & Security > Full Disk Access**, then relaunch the app. Without it, opening those files fails with a permission error.

  System databases may also be locked. Quit their parent app before opening.
</Warning>

## Connection URL

```text theme={null}
sqlite:///path/to/database.db
```

See [Connection URL Reference](/databases/connection-urls) for all parameters.

## Features

* The sidebar lists tables and views. Internal `sqlite_*` tables are hidden.
* Table info shows columns, constraints, indexes, foreign keys, and DDL.
* Triggers can be viewed and edited.
* A file watcher tracks the database file. When it changes on disk, the sidebar object list reloads on its own. An open data tab keeps its rows until you refresh it.

## Troubleshooting

**Locked database**: Close other apps using the file, or check for WAL files (`database.sqlite-wal`, `database.sqlite-shm`) left by a crashed process.

**Can't open**: Verify the path exists and you have read permission on the file. For a protected folder such as `~/Library/Safari`, `~/Library/Messages`, or the Photos library, grant Full Disk Access and relaunch TablePro.
