Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

SQLite

SQLite: Get the information of all tables as HTML

You can get the information of all tables as HTML with headers with a one-liner like this: for i in `sqlite3 AdventureWorks.db ".tables"`; do echo "<h3>$i</h3><table>"; sqlite3 -html -header AdventureWorks.db "PRAGMA table_info('$i');"; echo "</table>"; done Note…

SQLite: Count the number of records in multiple tables with a shell script

Background In SQLite, you can list the name of tables with the .tables command or the following SQL: SELECT name FROM sqlite_master WHERE type = 'table' and name NOT LIKE 'sqlite_%' Problem You can't list the number of columns of multiple …