View Single Post
Old 09-02-2016, 07:05 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The code I posted is a snippet I got from chaley.

The code in the manual uses a compatibility layer providing the old and new apis, chaley's snippet directly accesses the new database classes... other than that it is basically the same I guess.
Though I have expanded the snippet to default to your currently-configured Calibre Library via prefs.

...

If you are going to use sqlite, you will have to write the functions and validation code to make sure you are modifying the database in accordance with calibre's scheme, but other than that you *should* be fine.
Previous experience with sqlite/clojure may very well trump using existing apis in that case.

Best of luck.
eschwartz is offline   Reply With Quote