---
title: "SQLite"
description: "Connect Metabase to a SQLite file, with every connection and sync setting explained."
url: "https://www.metabase.com/docs/latest/databases/connections/sqlite"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# SQLite

> SQLite isn't available for [Metabase Cloud](https://www.metabase.com/cloud).

To add a database connection, click the **grid** icon in the top right, and navigate to **Admin** > **Databases** > **Add a database**.

Fill out the fields for that database, and click **Save changes** at the bottom.

## Settings

You can edit these settings at any time. Just remember to save your changes.

### Connection string

Paste a connection string here to pre-fill the remaining fields below.

### Display name

The display name for the database in the Metabase interface.

### Filename

The location of the SQLite database (the absolute path).

### Re-run queries for simple explorations

Turn this option **OFF** if people want to click **Run** (the play button) before applying any [Summarize](https://www.metabase.com/docs/latest/questions/query-builder/summarizing-and-grouping.md) or filter selections.

By default, Metabase will execute a query as soon as you choose a grouping option from the **Summarize** menu or a filter condition from the [drill-through menu](https://www.metabase.com/docs/latest/questions/visualizations/drill-through.md). If your database is slow, you may want to disable re-running to avoid loading data on each click.

### Choose when Metabase syncs and scans

Turn this option **ON** to manage the queries that Metabase uses to stay up to date with your database. For more information, see [Syncing and scanning databases](https://www.metabase.com/docs/latest/databases/sync-scan.md).

#### Database syncing

If you've selected **Choose when syncs and scans happen** > **ON**, you'll be able to set:

- The frequency of the [sync](https://www.metabase.com/docs/latest/databases/sync-scan.md#how-database-syncs-work): hourly (default) or daily.
- The time to run the sync, in the timezone of the server where your Metabase app is running.

### Scanning for filter values

Metabase can scan the values present in each field in this database to enable checkbox filters in dashboards and questions. This can be a resource-intensive process, particularly if you have a large database.

If you've selected **Choose when syncs and scans happen** > **ON**, you'll see the following options under **Scanning for filter values**:

- **Regularly, on a schedule** allows you to run [scan queries](https://www.metabase.com/docs/latest/databases/sync-scan.md#how-database-scans-work) at a frequency that matches the rate of change to your database. The time is set in the timezone of the server where your Metabase app is running. This is the best option for a small database, or tables with distinct values that get updated often.
- **Only when adding a new filter widget** is a great option if you want scan queries to run on demand. Turning this option **ON** means that Metabase will only scan and cache the values of the field(s) that are used when a new filter is added to a dashboard or SQL question.
- **Never, I'll do this manually if I need to** is an option for databases that are either prohibitively large, or which rarely have new values added. Use the [Re-scan field values](https://www.metabase.com/docs/latest/databases/sync-scan.md#manually-scanning-column-values) button to run a manual scan and bring your filter values up to date.

### Periodically refingerprint tables

> Periodic refingerprinting will increase the load on your database.

Turn this option **ON** to scan a sample of values every time Metabase runs a [sync](https://www.metabase.com/docs/latest/databases/sync-scan.md#how-database-syncs-work).

A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.

## Writable connection

Set up an additional connection used for write operations. See [Writable connections](https://www.metabase.com/docs/latest/databases/writable-connection.md).

## Database routing

With database routing, an admin can build a question once using one database, and the question will run its query against a different database with the same schema depending on who is viewing the question.

See [Database routing](https://www.metabase.com/docs/latest/permissions/database-routing.md).

## Danger zone

See [Danger zone](https://www.metabase.com/docs/latest/databases/danger-zone.md).

## Further reading

- [Managing databases](https://www.metabase.com/docs/latest/databases/connecting.md)
- [Metadata editing](https://www.metabase.com/docs/latest/data-modeling/metadata/metadata-editing.md)
- [Models](https://www.metabase.com/docs/latest/data-modeling/models/models.md)
- [Setting data access permissions](https://www.metabase.com/docs/latest/permissions/data.md)
