> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-docs-fix-500-query-results.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

Point the connection at a file that does not exist yet and it is created on connect, so a scratch database costs one filename and one click.

## Quick setup

Click **Create Connection…**, select **SQLite**, pick the file with **Browse…**, and click **Save & Connect**. There is no host, port, or credential to fill in. The driver ships inside TablePro and reads the file through the SQLite that macOS supplies, so there is no server version to match.

`.db`, `.db3`, `.s3db`, `.sl3`, `.sqlite`, `.sqlite3`, and `.sqlitedb` files list TablePro under Finder's **Open With**, as an alternate handler rather than the default one. To make a double-click open them here, select one in Finder, press `Cmd+I`, set **Open with** to TablePro, and click **Change All…**.

<Frame caption="SQLite connection form">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/sqlite-connection-form.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=4fa881baa5c4c11a428f736e46d9a40f" 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-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/sqlite-connection-form-dark.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=9bbce9bdfdace2f6c1b954dca8f4e20e" 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.

  Those databases are also often locked by the app that owns them. Quit it first.
</Warning>

## Connection URL

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

See [Connection URL Reference](/connections/urls) for all parameters.

## Browsing

The sidebar lists tables and views and hides the internal `sqlite_*` tables. Each table carries its columns, constraints, indexes, foreign keys, and DDL; triggers can be read and edited.

Change the file outside TablePro and the object list reloads on its own. Rows already loaded in a tab stay until you refresh that tab.

One connection is one file, with no database to switch between, and the object list reads the main database only: a file you `ATTACH` in the editor is queryable as `alias.table` but never appears in the sidebar.

## Limitations

* Encrypted databases do not open. The driver uses the system SQLite, which takes no key, and the form has nowhere to put one. Decrypt a SQLCipher file with the `sqlcipher` tool first.

## Troubleshooting

### database is locked

Another process holds a write lock. Quit the app that owns the file, or look for `-wal` and `-shm` files a crashed process left behind. The wait runs until the [query timeout](/customization/general-settings#query-timeout); **Query > Cancel Query** ends it sooner.

### unable to open database file

The path is wrong, or the folder is one you cannot read. For anything under `~/Library`, grant Full Disk Access and relaunch.

### file is not a database

The file is encrypted or is not SQLite at all. `file database.db` names what it actually is.
