View Single Post
Old 02-04-2010, 11:33 AM   #7
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by chaley View Post
I have used SQL successfully to browse the calibre DB. Starson17 suggested using SQLiteSpy, and it works well for browsing.
Personally, I only use SQLiteSpy to get a list of all duplicate books, and for really complicated regex queries, not to modify the database. However, it is possible to modify it, despite the triggers. If you really want to do this, you can save the triggers, drop them, make your db changes and recreate them.

The triggers for each table can be seen by selecting the trigger (at the left), right click and choose the "Show CREATE" option. Then you can save that CREATE as an SQL. To remove it, choose DROP instead of Show CREATE. After dropping the triggers, normal SQL commands will work.

When done making database changes, you would need to add the dropped trigger(s) back by running the saved SQL CREATE for each trigger. Changes to author or title will break your database without corresponding changes in the file structure. Changes in any table will need to replicate the functions in the triggers, and changes in the book table are particularly tricky (note the uuid related trigger).

If you try this, you are playing with fire. If you break it, you get to keep both halves (or even more pieces), so make lots of backups and test very, very, carefully. Running the database integrity before and after would also be advisable.
Starson17 is offline   Reply With Quote