Commit Graph

16 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 5dfb4e9dd6 xapian-db: use get_msg on exception
We were using get_error_string, but that might be NULL,
which libfmt doesn't like much.
2024-03-15 22:45:37 +02:00
Dirk-Jan C. Binnema 9fd0d2be12 clang: fix some compiler warnings
From CI.
2024-03-15 19:47:30 +02:00
Dirk-Jan C. Binnema 62f0a9a902 lib/mu-xapian-db: handle exception with dec_transaction_level
I.e., do our book-keeping beforehand.
2024-01-23 19:15:30 +02:00
Dirk-Jan C. Binnema 8366e009cb xapian-db: handle doc-not-found error in catch handler 2023-12-31 07:50:54 +02:00
Dirk-Jan C. Binnema f3f4ea65ab xapian-db: improve some error messages
Correctly handle re-opening a transaction after one has finished.

Recognize some database opening errors and give some better user hints.

Fixes #2615.
2023-12-29 22:28:10 +02:00
Dirk-Jan C. Binnema 146b80113f lib: move transaction handling to mu-xapian
Instead of handling transactions in the store, handle it in xapian-db.
Make the code a bit more natural / cleaner-out

Handle transaction automatically (with a batch-size) and add some RAII
Transaction object, which makes all database interaction transactable
for the duration. So, no more need for explicit parameters to
add_message while indexing.
2023-12-22 21:24:41 +02:00
Dirk-Jan C. Binnema 655a6b0499 lib: xapian-db/config: more tests
...and xapian-db gets a small API update, update store as well.
2023-09-23 09:27:46 +03:00
Dirk-Jan C. Binnema c78dafd723 provide end-user hints and show them
Only a few for now.
2023-09-16 11:12:16 +03:00
Dirk-Jan C. Binnema 9dcbe1d96c lib: unit tests: improve / better coverage 2023-09-13 23:02:53 +03:00
Dirk-Jan C. Binnema 89ed21e0c5 lib: improve printability for some types
A little fmt pixie dust
2023-09-09 17:26:20 +03:00
Dirk-Jan C. Binnema 4c0b7db3d8 store: add 'add_document' optimization, use it
*Usually* we need Xapian's replace_document() API, but when we know a
document (message) is completely new, we can use the faster
add_document(). That is the case with the initial (re)indexing, when
start with an empty database.

Also a few smaller cleanups.
2023-07-25 23:56:19 +03:00
Dirk-Jan C. Binnema 72f43f11df lib: improve store error messages
Use xapian_try_result
2023-07-23 21:04:26 +03:00
Dirk-Jan C. Binnema 0b4f7c4cbe lib: xapian-db/store: simplify
No need for "pimpl" in xapian-db; keep it simple.
2023-07-10 23:15:40 +03:00
Dirk-Jan C. Binnema 4920b56671 update to use fmt-based apis
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05 23:10:13 +03:00
Dirk-Jan C. Binnema 867f3205e2 lib/xapian-db: add missing include unordered_map 2023-07-02 10:08:58 +03:00
Dirk-Jan C. Binnema c28fde9155 lib: create mu-xapian-db, mu-config
XapianDb is a fairly thing wrapper around Xapian, which handles locking,
exception handling and some tracking.

On top of that, Config add a configuration database for type /
introspectable configuration info.
2023-07-02 00:06:56 +03:00