View Single Post
Old 09-02-2016, 04:29 PM   #3
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)
If you directly manipulate the db, then it is up to you to make sure you don't break anything... I strongly encourage you to use the `calibredb` CLI backend, or if you need a lot of flexibility, using the calibre apis via `calibre-debug` python scripts. e.g.

Code:
def init_cache(library_path=None):
    if not library_path:
        from calibre.utils.config import prefs
        library_path=prefs['library_path']
    from calibre.db.backend import DB
    from calibre.db.cache import Cache
    backend = DB(library_path)
    cache = Cache(backend)
    cache.init()
    return cache
This grants you access to the functions described in API Documentation for the database interface
eschwartz is offline   Reply With Quote