View Single Post
Old 09-14-2014, 10:24 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You absolutely should not use SQL to make changes to the calibre database.

Do this instead:

Code:
from calibre.library import db
db = db().new_api
books = db.search('authors:"=KH.SCHEER"')
db.set_field('authors', {book_id:'Karl Herbert Scheer' for book_id in books})
Using SQL to change authors will, for instance, mean that the filenames of the actual ebook files will not be changed to match the new author names. The values of author_sort in the authors table will not be changed and so on. Generally speaking, calibre's database is not a wrapper around sqlite. It has far more features than sqlite, so using SQL directly will cause all sorts of problems.

Last edited by kovidgoyal; 09-14-2014 at 11:11 PM.
kovidgoyal is offline   Reply With Quote