Operator On The Wire
Join
← Back to Knowledge Base
RED TEAM / SQL / SQLITE / ENUMERATION

Schema Enumeration

-- All tables
SELECT name 
FROM sqlite_master 
WHERE type='table';

-- All views
SELECT name 
FROM sqlite_master 
WHERE type='view';

-- All indexes
SELECT name, tbl_name, sql 
FROM sqlite_master 
WHERE type='index';

-- All triggers
SELECT name, tbl_name, sql 
FROM sqlite_master 
WHERE type='trigger';

-- Full schema dump
SELECT sql 
FROM sqlite_master 
WHERE sql NOT NULL;