async fn delete_entries_for_dict(
pool: &SqlitePool,
dict_id: i64,
shutdown: &ShutdownSignal,
) -> Result<u64, Error>Expand description
Deletes all index entries for a single dictionary in batches.
Each batch selects up to BATCH_SIZE primary key pairs (word, offset)
for the given dict_id, then deletes those specific rows in a single
transaction. This keeps write locks short while avoiding per-row overhead.
DELETE … LIMIT is not used because the bundled SQLite amalgamation in
libsqlite3-sys was not generated with SQLITE_UDL_CAPABLE_PARSER, so
the parser grammar does not support that syntax regardless of compile flags.
Returns the total number of rows deleted, or an error if any batch fails. Respects the shutdown signal between batches: if a shutdown is requested mid-way, the function returns early with the count deleted so far.