Category Archives: Hacks

Lightroom SQLite Magic

You may know that the Adobe Lightroom catalog (.lrcat) file is actually just an SQLite database. That means you can use the regular SQLite tools on it. I wanted to grab a simple list of all files in my Lightroom catalog, so I came up with this query to do the job:

SELECT root.absolutepath||folder.pathfromroot||file.idx_filename AS path
FROM aglibraryrootfolder AS root
INNER JOIN aglibraryfolder AS folder
ON folder.rootfolder=root.id_local
INNER JOIN aglibraryfile AS file
ON file.folder=folder.id_local;