Thread: SQL Queries
View Single Post
Old 06-04-2009, 04:25 PM   #8
iain_benson
Connoisseur
iain_benson began at the beginning.
 
iain_benson's Avatar
 
Posts: 58
Karma: 37
Join Date: Oct 2008
Device: PRS-600
Ah, I see, now I've looked at the code I see that even if SQL was there to stay, it still wouldn't be very nice

It looks like it only really queries the SQL database once to get a big table of all the books, and then relies on python itself to do the searching and filtering ... I'd assumed that all the queries would be SQL.

Just playing around with database2.py and calibre-debug --update-module and extending the "SELECT * from meta" in the refresh function I've managed to make it do what I wanted, but as this is changing the master query the reported number of books in the database drops to only the number returned, and I could possibly damage my database by editing anything in this state. Looking through, though, it is probably safe as all the updates are done directly into the SQL and read back in.
iain_benson is offline   Reply With Quote