Is there official documentation for the Lightroom catalog database schema?
Asked 10/4/2017
73 views
2 answers
0
I want to query a Lightroom catalog directly in SQLite and need to understand the catalog schema, including tables, relationships, and likely foreign keys. For example, I found EXIF data in AgHarvestedExifMetadata and want to relate it back to the source image records in AgLibraryFile, but I can't find clear documentation on how Lightroom links these tables. Is there any official schema documentation, or are there reliable community references and examples for working with the Lightroom catalog structure?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
8y ago
2 Answers
8
I am sure there is no official documentation - Adobe does not really want us poking around in there. Having said that there are a few blog posts with information around the contents of the catalogue and even a few that deal with that table. Here are a few links...
This does not specifically address your question but may shed light on how it is joined to other tables: http://www.max.grenkowitz.net/?topic=1057
This article has several sql statements that might help you figure out how the table relates to others: https://forums.adobe.com/thread/1812037
A nice overview with additional links and some examples: http://www.earthboundlight.com/phototips/querying-sqlite-lightroom-database.html
Another example using that table: http://www.wideopenlens.com/blog/2012/08/hacking-lightroom-or-why-everyone-should-know-how-to-program
Originally by user20973. Source · Licensed CC BY-SA 4.0
user20973
8y ago
0
Generated from our catalog & community — verify before relying on it.
There does not appear to be official Adobe documentation for Lightroom’s internal catalog schema. Community answers indicate Adobe doesn’t encourage direct catalog hacking, so most available information is unofficial.
Useful sources mentioned include community blog posts, Adobe forum threads with sample SQL, and unofficial schema references. One especially helpful clue is that AgHarvestedExifMetadata appears to link to the image table through an image field referencing Adobe_images.id_local, rather than directly to AgLibraryFile. A community Python project (openroom) models this as:
AgHarvestedExifMetadata.id_local= primary keyAgHarvestedExifMetadata.image→Adobe_images.id_local
So if you’re trying to reach file information, you may need to go through the image table first rather than joining EXIF directly to AgLibraryFile.
In short: no official schema docs are known, but unofficial references, example SQL, and reverse-engineered models are the practical way to understand Lightroom catalogs.
Recommended products
UniqueBot
AI8y ago
Your Answer
Related Questions
Can I keep a Lightroom 5 catalog and photos in Google Drive to use on two computers?
How can I find and install user-created lens profiles for Lightroom 3 and Camera Raw 6.1?
Is there an XMP tag for recording the scanner used to digitize a print?
How can I merge Lightroom folder structures without losing edits or metadata?
Will captions from Photoshop Elements Organizer carry over to Lightroom?