sqlite-tables

Parses a SQLite database file and retrieves the schema list. You can view the name and SQL definition of all schema objects defined in the database, including tables, indexes, and views.

Command properties

ItemDescription
Command typeDriver query
Required permissionNone
License usageCounted
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

sqlite-tables FILE_PATH

Target

FILE_PATH
Path to the SQLite database file to query

Output fields

FieldTypeDescription
typestringSchema object type. table, index, view, etc.
namestringSchema object name
table_namestringName of the table the schema object belongs to. For indexes, returns the name of the indexed table.
root_pagelongRoot page number of the schema object
sqlstringSQL definition of the schema object

Error codes

Parse errors

N/A

Runtime errors
Error codeMessageDescriptionPost-processing
-IOExceptionThe SQLite database file cannot be read.Aborts query execution.

Description

The sqlite-tables command directly parses the specified SQLite database file at the binary level to retrieve schema information equivalent to the sqlite_master table. Because it does not rely on the SQLite library, it can query locked database files as well.

Output results include not only tables but also all schema objects defined in the database, such as indexes and views. The sql field contains the CREATE statement for each object, which allows you to understand the column structure and types.

After checking the table structure, you can use the sqlite-records command to retrieve records from a specific table.

Examples

  1. Retrieve the schema list from a SQLite database

    sqlite-tables /opt/logpresso/evidence/History
    

    Retrieves all schema objects from Chrome's History file.

  2. Filter only table schemas

    sqlite-tables /opt/logpresso/evidence/History
    | search type == "table"
    

    Filters and retrieves only tables from the schema objects.

  3. View the SQL definition of a specific table

    sqlite-tables /opt/logpresso/evidence/places.sqlite
    | search name == "moz_places"
    

    Retrieves the SQL definition of the moz_places table from Firefox's places.sqlite file.