published on 23.04.2008 18:03.

Firefox 3 uses sqlite to store bookmarks (and most other things)

ever wanted to search your bookmarks with

SELECT * FROM moz_bookmarks WHERE title LIKE "%ruby%";

now you can:

in your firefox profile directory (~/Library/Application Support/Firefox/Profiles/xxxx.default on a Mac), type:

# open db file
$ sqlite3 places.sqlite

# show available tables
sqlite> .tables

# set output to sql insert statements
sqlite> .mode insert

# send output to file "firefox_bookmarks" 
sqlite> .output firefox_bookmarks

sqlite> SELECT * FROM moz_bookmarks WHERE title LIKE "%ruby%";

# list other available commands & options
sqlite> .help

Or, if you want JSON output you can export all bookmarks via the GUI. Use Bookmarks > Organize Bookmarks, click the rightmost icon in the top navigation and choose Export.

Posted in ,  | Tags , , ,  | no comments | no trackbacks

published on 01.03.2006 12:58.

MySql tip of the day

using regular expressions for criteria

SELECT style_number, LENGTH(style_number) 
FROM articles 
WHERE style_number REGEXP '^(89|98)[0-9]+$'

you can also use RLIKE. and it runs much faster than expected, too!

Posted in  | Tags