DocsData

Existing SQLite databases

Use a SQLite database you already have, in place, as collections.

Attach a SQLite file, and each of its tables becomes a collection, with an API, rules, live updates and the admin, read and written where it is. Nothing is copied, and nothing is added to the file. To attach one:

sluurp serve --attach shop=./northwind.db

That’s all it takes to explore it; no app is needed. Open the admin at /_/, where each table is a collection to browse, filter, edit and query with SQL. To also serve a frontend, add --public ./app.

Names

  • The table products in shop becomes the collection shop_products.
  • The column ProductName becomes the field product_name.
  • To attach several files, repeat --attach.

Behaviour

  • 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.
  • Ids: 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.
  • History, search and the recycle bin apply to what is written through Sluurp. A change another program makes to the file is seen, but not recorded.

How it works

The file is attached to each connection under its name. Each table is seen through a temporary view with triggers that write through to it, made when a connection opens and gone when it closes. That is why nothing is added to your file.

View as Markdown