SQLite

From Segfault
Jump to: navigation, search

Installation

fossil clone http://www.sqlite.org/cgi/src sqlite3.fossil                # Uses the fossil SCM program
mkdir sqlite-fossil && cd sqlite-fossil

fossil open ~/sqlite3.fossil 

TBD! Somehow this doesn't work:

$ fossil open ~/sqlite3.fossil 
SQLITE_CANTOPEN: cannot open file at line 29297 of [ea3317a480]
SQLITE_CANTOPEN: os_unix.c:29297: (21) open(/usr/local/src/sqlite-fossil) - 
SQLITE_CANTOPEN: statement aborts at 5: [ATTACH DATABASE '/usr/local/src/sqlite-fossil' AS repository] unable to open database:
/usr/local/src/sqlite-fossil
fossil: unable to open database: /usr/local/src/sqlite-fossil: {ATTACH DATABASE '/usr/local/src/sqlite-fossil' AS repository}

If you have recently updated your fossil executable, you might
need to run "fossil all rebuild" to bring the repository
schemas up to date.

Usage

$ DB=$HOME/.mozilla/firefox/SomeProfile/places.sqlite
$ for t in `sqlite3 $DB .tables`; do
    printf "table: $t   "
    sqlite3 $DB "select count(*) from $t;"
done | sort -nk3

table: moz_keywords   0
table: moz_bookmarks_roots   5
table: moz_anno_attributes   13
table: moz_items_annos   26
table: moz_bookmarks   307
table: moz_annos   895
table: moz_inputhistory   2986
table: moz_favicons   9201
table: moz_hosts   11858
table: moz_places   104839
table: moz_historyvisits   156479

Links