SQLite test-database generator
Build a real SQLite database right in your browser: a huge one (up to 50 GB), one with thousands of tables, or one with 2,000 columns. Every file passes PRAGMA integrity_check. Then drop it on the SQLite viewer to see how far a browser tab can go. Nothing is uploaded.
What’s inside
Big is a small shop — users, products, orders (with foreign keys to both) and a big_spenders view — plus an events table that keeps growing until the file reaches your target size. Its columns use the declared types real schemas use: INTEGER PRIMARY KEY, VARCHAR(120), DATETIME, DECIMAL(12,2), BOOLEAN, JSON, BLOB. A 20 GB file holds about 180 million events.
Many tables writes t_00001 … t_N, each with five columns, a foreign key to the previous table (every tenth breaks the chain), and a few rows. It stresses the schema: 10,000 tables is 10,000 CREATE TABLE rows in sqlite_schema.
Many columns writes one table as wide as SQLite allows by default — 2,000 columns — cycling through twelve declared types. Each row is ~15 KB, so every row spills into overflow pages.
How it works — no SQLite library
A SQLite file is an array of fixed-size pages, and every table is a b-tree of those pages. The generator writes that format directly: rows arrive in rowid order, so leaf pages fill left to right and are written the moment they’re full; each finished leaf hands its page number and largest rowid to the level above, which does the same. Every page gets the next free page number as it’s written, so the file streams out strictly in order — except page 1, the header and root of sqlite_schema, which needs every table’s root page number and is therefore written last, at offset 0.
Memory holds one page per b-tree level, whatever the size. Where the browser supports the File System Access API (Chrome, Edge, Opera) the pages go straight to the file you pick, 4 MB at a time; elsewhere the file is assembled as a Blob in memory and downloaded — fine for a few hundred megabytes. The full story, with code, is in how to open a 20 GB SQLite database in the browser.
Prefer a terminal? The same writer runs under Node: node sites/omni/tools/gen-sqlite.mjs --shape big --size 20GB --out big.sqlite in the repository.
Limits — SQLite’s, and the browser’s
| Limit | Value | Where it comes from |
|---|---|---|
| Largest database | ≈ 281 TB | 4,294,967,294 pages × 65,536 bytes (SQLITE_MAX_PAGE_COUNT) |
| Columns per table | 2,000 | SQLITE_MAX_COLUMN default; a build can raise it to 32,767, but a default build then refuses the file |
| Largest value (TEXT or BLOB) | 1,000,000,000 bytes | SQLITE_MAX_LENGTH default |
| Tables | no fixed cap | each is one sqlite_schema row; opening a database parses them all |
| Rows per table | 264 | the rowid is a signed 64-bit integer |
| Largest file a browser tab can open here | disk-bound | the viewer reads pages on demand, so a 20 GB file uses the same memory as a 20 MB one; a full scan runs at disk speed |
| Largest file this page can write | 50 GB (FS Access) | a self-imposed cap; the Blob fallback is limited by browser memory |