How does Firefox reference Bookmarks to Tags in places.sqlite?

Firefox Bookmarks are saved in the table moz_bookmarks in the database file places.sqlite.

see table overview:

a single bookmark may look like this:

id 77 type 1 fk 73 parent 3 position 1 title Google

now I add two Tags to this bookmark in Firefox. Lets name them tag1 and tag2.

The line of the Google bookmark is not changed in the moz_bookmarks table.

Instead the two new tags are added to the end of the table.

example for "tag1":

id 120 type 2 fk (empty) position 0 title tag1


I want to know where Firefox is linking the Google Bookmark to the newly created Tag. There is no reference in the Google Bookmark table entry to tag1 or tag2.

I've looked in every other table of places.sqlite (using SQLite Database Browser, you can get it at SourceForge) and I see nowhere a link between the bookmark and the tags.

Documentation on this subject is very sparse and often 2 years old. The Firefox source code consists of 60.000 files, so it's not easy to do anything with it quickly.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Greg WrightSr. Database AdministratorCommented:
Here's what is going on. Kinda of confusing, yet, but this should clear it up.

My photo shows a sample from my bookmarks on the following items:
*) Bookmark = "Mozilla Firefox Start Page"
*) Tag 1 = "Sample 1"
*) Tag 2 = "Sample 2"

Here is the breakdown, watch two things, the fk field, and the third record.

The bookmark has id = 2161 and fk = 11841.
The tag has been recorded as id = 2162 with fk = null, yet has the parent = 4, which ties it to the Tag parent grouping. This is how Firefox knows it falls in into Tags.
Then, and most importantly, the next record is id = 2163 with fk = 11841 (tie to the bookmark), and parent = 2162 (tie to the tag).

The last record is what ties the two (bookmark and tag) together.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.