GUIDES / EXPORT & BACKUP

Export SQLite to CSV, JSON or SQL Without Preview Truncation

A visible grid is a preview, not necessarily the whole result. SQLite Lab keeps previews small for responsiveness and gives complete exports a separate action. All processing happens on your device.

Export a table or filtered selection

Open a database and click a table. Use the filter and sort controls, then choose Export data. Select CSV or JSON and Current table with applied filters and sorting. The export includes all matching rows, beyond the 200-row page. Preview CSV and JSON buttons still export only the loaded result.

Export a complete SELECT result

Write one read-only SELECT and choose the editor as the export source. Export reruns that SELECT on the current data. A LIMIT written into your SQL is respected. Multiple statements, writes, PRAGMAs and unbound parameters are rejected. This example exports all sample customers.

SELECT id, name, email, country FROM customers
ORDER BY id;
Open this example for review →

Understand representation

JSON uses columns and rows arrays, preserving repeated column labels, with truncated: false on success. Large integers are exact decimal strings; NULL remains null; BLOBs use a $blob hex object. CSV quotes values, leaves NULL fields empty, writes BLOBs as 0x-prefixed hex, and prefixes formula-like text with an apostrophe. CSV is not a lossless type-preserving backup.

Save large exports

Where direct file saving is supported, chunks go to disk with backpressure. Other browsers accumulate at most 64 MiB before downloading. Exceeding the fallback limit fails clearly and produces no partial download. Cancel stops the operation; a single busy SQLite step can take time to respond. Export queries have a 120-second SQL execution budget, excluding file-write waits.

Choose SQL dump or database backup

SQL dump exports ordinary tables, stored data, indexes, views, triggers and AUTOINCREMENT sequence values. Restore it into an empty SQLite database using the command-line client; its transaction commands cannot run in this workspace. Virtual tables are unsupported, and hidden rowids and database settings are not retained. Export database preserves the complete SQLite snapshot, including BLOBs, but currently allocates the complete file in memory.

Restore a dump with the SQLite CLI

Run this shell command outside the browser after reviewing the downloaded SQL. Choose a new output filename. Keep your original database backup until you have compared the restored schema and row counts.

sqlite3 restored.sqlite < sqlite-export.sql

Keep exploring

SQLite syntax reference · Practice with a learning path · Sample datasets

CSV Data Types: Preserve IDs and Clean Numbers

Reference: Official SQLite documentation