View Single Post
Old 12-26-2015, 08:40 AM   #8
tieum
Junior Member
tieum began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2015
Device: Booken Muse
sql update

Quote:
Originally Posted by Pinguin44 View Post

Code:
AttributeError: 'LibraryDatabase2' object has no attribute 'execute'
Hi, I encountered the same issue for a sql update today: after a massive import on my new calibre-server, I wanted to set the timestamp to the published date

If anyone is stuck like I was: you can call execute() through db.conn

e.g.:
Code:
calibre-debug -c "from calibre.library.database2 import LibraryDatabase2;
db = LibraryDatabase2('/home/path/to/my/calibre-library/');
db.conn.execute('update books set timestamp=pubdate');
db.conn.commit();"
Happy holidays!
tieum is offline   Reply With Quote