-
Notifications
You must be signed in to change notification settings - Fork 24
Queries
shrsv edited this page Dec 13, 2015
·
3 revisions
The two database files of concern are:
FILE1:
~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/BKLibrary-1-091020131601.sqlite
FILE2:
~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite
Select all titles available in the iBooks library:
select ZTITLE from ZBKLIBRARYASSET;
Get all asset ids that have at least one annotation (no duplicates):
select count(*), ZANNOTATIONASSETID from ZAEANNOTATION where ZANNOTATIONREPRESENTATIVETEXT IS NOT NULL group by ZANNOTATIONASSETID;
attach 'BKLibrary/BKLibrary-1-091020131601.sqlite' as db1;
attach 'AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite' as db2;
select a.ZTITLE, a.ZAUTHOR, b.ZANNOTATIONREPRESENTATIVETEXT
from db1.ZBKLIBRARYASSET a
inner join
db2.ZAEANNOTATION b
on b.ZANNOTATIONASSETID = a.ZASSETID
where b.ZANNOTATIONREPRESENTATIVETEXT is not NULL;
I can run the above statements real quick by doing this:
- Create
blah.txt
- Paste and save aforementioned statements in that file
- Goto
~/Library/Containers/com.apple.iBooksX/Data/Documents/
- Run
sqlite3
- In that shell, type
.read blah.txt
- That's it.