gizmobench
BrowseDaily

SQLite to CSV: Export a Table or Query

Open your SQLite database, choose a table and edit the single-table SELECT to select or filter its columns. Download full query CSV exports every row returned by that query when its scan finishes. Copy and Download export only the displayed page; this page starts with 25 rows per page so that boundary is visible. Each CSV includes a header and quoted text. This exports one supported query, not every table in the database at once.

sample.db6,144 bytes, 512-byte pages, UTF-8

tables 4

items

  • idINTEGER rowid
  • order_idINTEGER
  • productINTEGER
  • qtyINTEGER
  • noteTEXT
  • thumbBLOB

1 view: open_orders

opened read-only

24 of 24
idnotethumb
1gift wrapNULL
2NULLNULL
3NULLNULL
4back orderNULL
5NULLBLOB 16 bytes
6NULLNULL
7NULLNULL
8engraving: A.W.NULL
9NULLNULL
10NULLNULL
11NULLNULL
12left handedNULL
13NULLBLOB 14 bytes
14NULLNULL
15NULLNULL
16palletisedNULL
17NULLNULL
18NULLNULL
19NULLNULL
20the long note that follows is here to prove the reader follows an overflow chain: a row whose payload does not fit inside one 512-byte page is stored with the first part of the record on the leaf page and the rest on a chain of overflow pages, each of which begins with a four-byte pointer to the next one. A viewer that reads only the leaf page shows a value cut off at the page boundary and never says so, which is the failure this note exists to catch. Every character you can read here, all the way to the final full stop, came back out of that chain in order and was compared against the string that went in.NULL
21NULLNULL
22NULLNULL
23assortedNULL
24NULLNULL
page 1 of 1
Tables
4
Rows in table
24
Page size
Mode
Read-only

Copy and Download export the displayed page. exports every row returned by this supported SELECT only if its scan finishes.

24 rows on screen, 1 to 24 of 24 from items, page 1 of 1.

  • A 6,144-byte databasethe sample, read from this page
    4 tables, 64 rows, nothing written
  • NULL and BLOB columnsitems, mixed types
    NULL shows as NULL, a BLOB as its byte length: 16 bytes
  • UPDATE, ATTACH or an extensionany such statement
    UPDATE is refused here: the file is opened read-only and only SELECT runs.
Accuracy. Every byte comes from the SQLite file format, read in this browser: the file is opened read-only, never uploaded and never written back. Only SELECT over one table runs here, and a statement that would write, attach or load an extension is refused by name. Rows that live only in an unread -wal file, and tables in a shape this reader names as one it cannot decode, are reported rather than shown.

Common questions

Can SQLite to CSV export the whole query result?
Download full query CSV exports all rows returned by the supported SELECT, including its own LIMIT and OFFSET, independently of Page size. A stopped scan or sort refuses that full export rather than downloading a prefix. Copy and Download still export only the page on screen; the result status identifies those rows.
How do NULL, empty strings and BLOBs appear in the CSV?
NULL becomes an empty unquoted field, while an empty text string is a quoted empty field. Commas, quotes and line breaks are escaped using CSV quoting. A BLOB becomes metadata such as blob:16 bytes; its binary content is not exported.
Can I open the CSV in Excel?
Yes, import or open the CSV in spreadsheet software. This tool produces CSV text, not an .xlsx workbook, and spreadsheet type inference may alter large integer or date-like strings. Import those columns as text when their exact text matters.
Can it combine tables or export joined results?
This viewer reads one table at a time and refuses joins or functions. SQLite Playground executes joins and can copy its displayed result sets as tab-separated text; a desktop SQLite application can handle complete database exports.

Every byte comes from the SQLite file format, read in this browser: the file is opened read-only, never uploaded and never written back. Only SELECT over one table runs here, and a statement that would write, attach or load an extension is refused by name. Rows that live only in an unread -wal file, and tables in a shape this reader names as one it cannot decode, are reported rather than shown.