It is pretty easy to get to those annotations. Here is an idea:
That file (books.db) is a simple sqlite database. You can query it using any sqlite3 client, but to do it properly you need the json1 extension installed as well. Here is a sample query that gives you a neatly formatted html table (see attached):
Code:
echo "<HTML><BODY><TABLE>"$(sqlite3 --header --html books.db "select Title, Authors, json_extract(Highlight, '$.text') as Text from Books inner join (select OID as BookID, Highlight from Items inner join (select ParentID, Highlight from Items inner join (select ItemID, Val as Highlight from Tags where TagID = 104 and Val <> '{\"text\":\"Bookmark\"}') as Highlights on Highlights.ItemID = OID) as Highlights on Highlights.ParentID = OID) as Highlights on BookID = OID;")"</TABLE></BODY></HTML>" > highlights.html
You can extend this to extract other annotations (e.g. note, bookmark) as well as page/position number for each annotation.