Skip to content

SQLite for Mere Mortals

SQLite is a database that lives in a single file. No server to install, no accounts, no ports: you open library.db and you're talking SQL to your data. It's also, quietly, the most deployed database on Earth — inside every phone, every browser, most apps you've ever used, and (if you run certain projects from a certain guide author) a BBS simulator and a Usenet catalog or two.

This guide assumes you can use a terminal and edit a text file. No database experience is assumed; SQL is taught as it's used.

What this guide covers

What it doesn't cover

Running a multi-user database server (that's SQLite's cousins' job), SQL beyond the practical middle, and database design theory past the working rules given here.

How to use this guide

Every command was run for real against SQLite 3.45 — including a 100,000-row table built to measure an index (0.020s → 0.000s), a transaction rolled back mid-flight, a backup restored, JSON documents queried, and a write refused with database is locked while another connection held the file. The examples/ build the same library database the chapters use.


Part of the series

This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.

Related guides:

License

The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.