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
| Item | Description |
|---|---|
| Command type | Driver query |
| Required permission | None |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
Target
FILE_PATH- Path to the SQLite database file to query
Output fields
| Field | Type | Description |
|---|---|---|
type | string | Schema object type. table, index, view, etc. |
name | string | Schema object name |
table_name | string | Name of the table the schema object belongs to. For indexes, returns the name of the indexed table. |
root_page | long | Root page number of the schema object |
sql | string | SQL definition of the schema object |
Error codes
Parse errors
N/A
Runtime errors
| Error code | Message | Description | Post-processing |
|---|---|---|---|
| - | IOException | The 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
-
Retrieve the schema list from a SQLite database
sqlite-tables /opt/logpresso/evidence/HistoryRetrieves all schema objects from Chrome's
Historyfile. -
Filter only table schemas
sqlite-tables /opt/logpresso/evidence/History | search type == "table"Filters and retrieves only tables from the schema objects.
-
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_placestable from Firefox'splaces.sqlitefile.