![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2024
Device: Kobo
|
Fastest way to query calibre database
Hello there!
I'm a new user of calibre who's getting into it to organise my collection of books (mainly pdfs) and I was wondering what was the best way to query the database? I've been wanting to make a small shell script that gets the titles of all books in the calilbre database (for a drun like selection menu before opening their files in zathura) and wondered what was the fastest way to do it? I'm currently getting them all with `calibredb list -f title` sometimes with an extra `--with-library` command while calibre itself is running, but I was wondering if anyone else had some faster suggestions? Currently it's taking 0.3-0.4 second per query and gives noticeable lag when trying to load up the drun replacement I have (tofi). Thank you all for your help! shadowstone |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,219
Karma: 23446406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibredb is fairly slow to startup mostly because of python interpreter startup lag. In addition it has to open and parse metadata.db on every invocation. You can get an idea of the breakup of times for these two tasks by contrasting the time taken for
calibredb --help vs calibredb list --limit=1 The latter of the two can be reduced by having calibredb connect to a running calibre-server instance. Or you can just use one of the JSON endpoint of the calibre server directly, which should be basically instantaneous. This does require keeping calibre running in the background. If you dont want to do that, you can just query metadata.db yourself using some sqlite tool. Getting a list of titles from it is pretty trivial, it involves simply reading the title column from the books table. |
![]() |
![]() |
![]() |
#3 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jun 2024
Device: Kobo
|
Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Companion - metadata only query | Josieb1 | Calibre Companion | 9 | 11-12-2015 08:47 AM |
Calibre Database cp Kindle Database | mitch13 | Library Management | 1 | 05-22-2011 07:33 PM |
PC Memory use of Calibre query | JustinD | Calibre | 1 | 03-28-2011 07:29 PM |
Query regarding Calibre setup | culpr1t | Calibre | 3 | 01-11-2011 03:02 PM |
Query about Calibre 0.7.9 and request | mitch13 | Calibre | 5 | 07-22-2010 10:19 PM |