---
title: Existing SQLite databases
description: Use a database you already have, in place, as collections.
section: Data
order: 7
---

# Existing SQLite databases

<p class="lead">Already have a SQLite file? Attach it, and each of its tables becomes a collection, with an API, rules, live updates and the admin UI, read and written where it is. Nothing is copied, and nothing is added to the file.</p>

```sh title="Terminal"
sluurp serve --attach shop=./northwind.db
```

That's all it takes to explore it: no app needed. Open the admin UI at `/_/`, where each table is a collection to browse, filter, edit and query with SQL. Add `--public ./app` when you also have a frontend to serve.

- `products` in `shop` becomes the collection `shop_products`; a column `ProductName` becomes the field `product_name`.
- Writes go straight to your table, so other programs using the file see them at once.
- A new collection starts closed: only administrators see it until you give it [rules](/docs/collections).
- Attach several files by repeating `--attach`.
- A table without a text `id` column keeps its ids in Sluurp's own file, beside each row's rowid. A row written by another program shows its rowid as its id.

The file is attached to each connection under its name, and each table is seen through a temporary view with triggers that write through to it, made as a connection opens and gone when it closes. That is why nothing is added to your file.

History, search and the recycle bin apply to what is written through Sluurp; a change another program makes to the file directly is seen, but not recorded.
