Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 03-17-2026, 04:49 PM   #1
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
JSON vs SQLITE

Moving into the next phase of Reading Tracker plugin, I am exploring backup/import/export utility. For what this plugin does, what would make the most sense, JSON files or SQLITE? Currently some json files are in use, but moving into the next phase I want to ensure the correct choices are made.

As of now the plugin does the following:
Bulk metadata retrieval
Sorting and filtering
Dynamic queries
Yearly aggregation of reading and book statistics
Streak calculation with date parsing and timezone awreness
Tracking progress vs goals; challenge vs goals
Journal logging
Reading challenge management

If a user wants to load in a library of tens of thousands of books would json files be enough for export/import? Sqlite?
Any insight would be appreciated.

Couple of screenshots included for the cat tax.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2026-03-17 154031.png
Views:	38
Size:	107.9 KB
ID:	221863   Click image for larger version

Name:	Screenshot 2026-03-17 154140.png
Views:	40
Size:	269.4 KB
ID:	221864  
varia is offline   Reply With Quote
Old 03-17-2026, 05:04 PM   #2
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 2,053
Karma: 7956099
Join Date: Sep 2020
Device: none
I've wondered the same thing so many times.
Comfy.n is online now   Reply With Quote
Advert
Old 03-17-2026, 05:26 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,632
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
These are really a 'summary' of a small defined subset of books gathered from a full library scan? The report would only update if the process triggers?

Those results should be fairly small, so the JSON should be also.
BTW That first thumbnail looks great
theducks is offline   Reply With Quote
Old 03-17-2026, 06:05 PM   #4
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by Comfy.n View Post
I've wondered the same thing so many times.
It's s struggle for sure. Part of me thinks it's overkill to layer on an SQLITE database for a simple (?) tracker but trying to rope in scattered json files is no picnic. On top of that I'm in expansion mode and I have no idea what features would work best with what.
varia is offline   Reply With Quote
Old 03-17-2026, 06:18 PM   #5
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by theducks View Post
These are really a 'summary' of a small defined subset of books gathered from a full library scan? The report would only update if the process triggers?

Those results should be fairly small, so the JSON should be also.
BTW That first thumbnail looks great
Yes, this shows a predefined list from a small test library. Upon first install the library is cached to an index.
Presumably most users would only want to track a relatively small list of books, but I am only guessing.
The plugin also creates files for challenges, goals, journal entries, and probably more to come with an upcoming new feature.
I suppose if users can back up all these as a single file, and import a single file (for instance after a reinstall), then it could work.
Thanks, still lots to do to get it to where I am 100% satisfied.
varia is offline   Reply With Quote
Advert
Old 03-17-2026, 07:27 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,523
Karma: 32600658
Join Date: Mar 2012
Location: Sydney Australia
Device: none
As I read this from Comfy.n, and the attached popop from his RSS Reader plugin, a SQLite database should not be located in the calibre configuration directory.

Yet, calibre stores its server-users.sqlite database in its configuration directory. Other apps also have sqlite databases stored in their equivalent to calibre's configuration directory - e.g. my %appdata%\Mozilla\Firefox directory has hundreds of them.

One advantage to .json files is that they can be accessed, and edited with a text editor, whereas a sqlite database requires a tool such as DB Browser or SQL Studio to do the same.

In my ideal world each plugin would have a subdirectory in which the plugin zip and all of its data, settings, help files etc were located.

BR
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2026-03-18 092100.jpg
Views:	20
Size:	35.8 KB
ID:	221866  
BetterRed is offline   Reply With Quote
Old 03-17-2026, 08:25 PM   #7
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by BetterRed View Post
As I read this from Comfy.n, and the attached popop from his RSS Reader plugin, a SQLite database should not be located in the calibre configuration directory.

Yet, calibre stores its server-users.sqlite database in its configuration directory. Other apps also have sqlite databases stored in their equivalent to calibre's configuration directory - e.g. my %appdata%\Mozilla\Firefox directory has hundreds of them.
BR
I'm no expert but that seems to make sense, storing a plugin database out of the calibre confic directory, just to be on the safe side.

Quote:
One advantage to .json files is that they can be accessed, and edited with a text editor, whereas a sqlite database requires a tool such as DB Browser or SQL Studio to do the same.
This did cross my mind so it's good to see that validation.


Quote:
In my ideal world each plugin would have a subdirectory in which the plugin zip and all of its data, settings, help files etc were located.
Do you mean packaged in such a way so as to install the plugin with all user data/settings etc already in place? Like a personal single-file backup being installed to a new computer?
Or just for the zip and all data/settings to be located in a single folder?
varia is offline   Reply With Quote
Old 03-17-2026, 09:41 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,523
Karma: 32600658
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by varia View Post
I'm no expert but that seems to make sense, storing a plugin database out of the calibre confic directory, just to be on the safe side.

This did cross my mind so it's good to see that validation.
Safe from what? Maybe Comfy.n can tell us.

Why should a sqlite file used by a calibre plugin be regarded as being any more precious than the sqlite files used by the Azardi epub viewer, the FDM download manager, the Firefox web browser, or the calibre server etc.

And, why would it be safer to store the sqlite file in let's say c:/users/<userid>/someplugin-data directory rather than c:/users/<userid>/appdata/roaming/calibre/plugins/someplugin-data/ directory. If the Backup Configuration Folder plugin is installed it'll get backed up when calibre is closed.

Quote:
Originally Posted by varia View Post
Do you mean packaged in such a way so as to install the plugin with all user data/settings etc already in place? Like a personal single-file backup being installed to a new computer?
Or just for the zip and all data/settings to be located in a single folder?
The latter.

One roadblock to my ideal, is that some plugins (e.g. View Manager, Count Pages, Quality Check etc) have library specific settings that are stored in the preferences table of the library metadata.db files.

Another is that some plugin settings are stored in calibre wide json files, e.g. window sizes and positions in gui.json, I have entries in there for plugins that I removed 10+ years ago

BR
BetterRed is offline   Reply With Quote
Old 03-17-2026, 09:46 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,632
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Something to consider
Does this DB need to be PER LIBRARY?
Some PI have generic settings in the Config folder and others become part of the DB because of the nature of custom columns makes the data only relevant to a specific library.
theducks is offline   Reply With Quote
Old 03-17-2026, 10:18 PM   #10
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: 46,131
Karma: 29626604
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You use sqlite if you need to modify individual rows in the larger dataset with good performance and make queries against the larger dataset using indices for speed. If nether of those are a concern either because of the design or because the dataset is not large then use JSON.
kovidgoyal is offline   Reply With Quote
Old 03-17-2026, 10:21 PM   #11
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 2,053
Karma: 7956099
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by BetterRed View Post
Safe from what? Maybe Comfy.n can tell us.
BR
"Safe" refers more to calibre cache dir, which is mentioned in your screenshot: outside calibre's config and cache folders. More often than not, programs can reset/delete/overwrite their cache folders. Also, placing a feeds database inside config dir would not be reliable for use with the Backup Config plugin, because this would significantly affect shutdown time.

BTW, I will soon release a plugin that will help users create all columns Reading Tracker requires with a single click.
Comfy.n is online now   Reply With Quote
Old 03-17-2026, 10:23 PM   #12
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by BetterRed View Post
Safe from what?
Big shrug on that one. Have no idea if a database situated in x or y folder can risk corruption from who knows what. I'm no programmer so I don't know what's the best practice. Personally I save no files to my C drive, only installed programs. Everything goes to partitions.

Ahh, yes, my plugins/ folder is a fright. It is mayhem in there. With this plugin I am working on, I am trying to keep things contained in one folder. A set standard would help to keep things organized.

Quote:
Originally Posted by theducks View Post
Something to consider
Does this DB need to be PER LIBRARY?
Some PI have generic settings in the Config folder and others become part of the DB because of the nature of custom columns makes the data only relevant to a specific library.
I am moving away from custom columns. I don't have an issue with them per se, but from observation it seems to be the most hated feature in Calibre plugins. My preference is for data, config, and settings files to all remain in the tracker folder, and not in multiple places. If worst comes to worst, a user would then be able to copy the folder with all plugin files in one go. I haven't explored multi-library setups yet to know how plugins work in those cases.
varia is offline   Reply With Quote
Old 03-17-2026, 10:28 PM   #13
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by kovidgoyal View Post
You use sqlite if you need to modify individual rows in the larger dataset with good performance and make queries against the larger dataset using indices for speed. If nether of those are a concern either because of the design or because the dataset is not large then use JSON.
Thank you, Kovid. That is helpful to know. That would mean JSON is the way to go for this plugin.
varia is offline   Reply With Quote
Old 03-17-2026, 10:29 PM   #14
varia
Connoisseur
varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'varia can spell AND pronounce 'liseuse.'
 
varia's Avatar
 
Posts: 57
Karma: 39844
Join Date: Jan 2026
Device: Samsung Galaxy Tab S10 Lite
Quote:
Originally Posted by Comfy.n View Post
BTW, I will soon release a plugin that will help users create all columns Reading Tracker requires with a single click.
This is possible?! Well blow me down!
varia is offline   Reply With Quote
Old 03-17-2026, 10:37 PM   #15
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 2,053
Karma: 7956099
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by varia View Post
This is possible?! Well blow me down!
I will see if I can release it today. Custom columns can be a pain to set up, but once they're in place it's the best approach IMO. They facilitate advanced searches.

@kovidgoyal thank you for the general guidelines!
Comfy.n is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which .json file? JSWolf Calibre 2 02-17-2025 04:17 PM
caps.json Rellwood Plugins 2 03-13-2022 04:02 PM
On the file metadata_db_prefs_backup.json Horus68 Calibre 2 06-03-2020 05:10 AM
How do I move JSON files? Rellwood Calibre 2 10-20-2015 12:26 AM


All times are GMT -4. The time now is 05:34 AM.


MobileRead.com is a privately owned, operated and funded community.