logo
Updated

SQLite

SQL

list all tables

SELECT 
    m.tbl_name AS table_name,
    p.name AS column_name,
    p.type AS data_type,
    CASE p.pk WHEN 1 THEN 'PRIMARY KEY' ELSE '' END AS key,
    CASE p."notnull" WHEN 0 THEN 'NULL' ELSE 'NOT NULL' END AS nullable
FROM 
    sqlite_master m
    LEFT JOIN pragma_table_info(m.name) p
WHERE 
    m.type = 'table' AND
    m.name NOT LIKE 'sqlite_%'
ORDER BY 
    m.tbl_name,
    p.cid;

Links

Aaron Francis
🎉 High Performance SQLite is live! This video course covers everything you need to know about SQLite. It's 65 videos across 6 modules, with at least 20 more videos to come. We're launching in early access today, so the price is currently discounted! Y'all go get it! https://t.co/t4JrO4MTD9