What is a database?

A database is where your app stores information that needs to stick around — form definitions, submissions, anything that should survive a page refresh or a server restart.

The spreadsheet analogy

Think of a database as a spreadsheet:

  • Tables are like sheets — one for forms, one for submissions
  • Rows are entries — each form you create is one row
  • Columns are fields — title, created date, the fields you defined

When your app needs to save a form, it adds a row to the forms table. When someone submits a form, it adds a row to the submissions table. When you view submissions, the app reads rows back out.

Why not just use a file?

You could save data to a text file. But files break when two people try to write at the same time — one person's data overwrites the other's. A database handles this automatically. It also lets you search, filter, and connect data across tables without writing your own logic.

SQLite

Your starter uses SQLite — a database that runs right inside your app. During development it's just a file on disk (data/dev.db). No separate server to install, no complicated setup. It's fast, reliable, and used by everything from phones to web browsers behind the scenes.

In production, Turso gives you the same SQLite engine as a hosted service for free — no code changes needed.

?Why SQLite?