bulk_mode#
- barecat.Index.bulk_mode(drop_indexes=False, update_dirs_at_end=True, update_treestats_at_end=True)[source]#
Context manager for bulk operations with automatic cleanup.
- Parameters:
drop_indexes (bool) – If True, drops indexes for maximum speed (use only for fresh/empty archives). If False (default), keeps indexes so that ON CONFLICT duplicate handling works (use for merges/updates).
update_dirs_at_end (bool) – If True (default), creates missing ancestor directories on exit.
update_treestats_at_end (bool) – If True (default), recomputes directory tree statistics on exit.
On exit: - Rebuilds indexes and triggers (if dropped) - Re-enables triggers and foreign keys (if not dropped) - Creates missing ancestor directories (if update_dirs_at_end) - Recomputes directory tree statistics (if update_treestats_at_end)