Obsah

SQL pomůcky

Vypsání tabulek v databázi

SELECT name FROM sqlite_master 
WHERE TYPE IN ('table','view') AND name NOT LIKE 'sqlite_%'
UNION ALL 
SELECT name FROM sqlite_temp_master 
WHERE TYPE IN ('table','view') 
ORDER BY 1

Vypsání sloupců v tabulce

PRAGMA table_info(tablename)

Vytvoření SQL pro tabulky

SELECT SQL FROM 
   (SELECT * FROM sqlite_master UNION ALL
    SELECT * FROM sqlite_temp_master)
WHERE TYPE!='meta'
ORDER BY tbl_name, TYPE DESC, name

Command line import

sqlite> .mode csv
sqlite> .separator "\t"
sqlite> .import /cesta/k/souboru TABULKA