Refactor database connection handling with connection pooling and parallel processing

- Introduced `r2d2` connection pooling for SQLite in `database.rs`.
- Updated `Indexer` to use pooled connections for improved concurrency.
- Replaced sequential processing with `rayon` for parallel file scanning.
- Added a `clear` method to `Indexer` for reindexing support.
- Enhanced database initialization with `init` and `from_pool` methods.
- Updated `Cargo.toml` and `Cargo.lock` to include `r2d2`, `r2d2_sqlite`, and new dependencies.
This commit is contained in:
elipeter 2025-06-17 20:45:33 +02:00
parent 1933082b41
commit 0a62b6f40c
5 changed files with 412 additions and 67 deletions

View file

@ -28,3 +28,5 @@ blake3 = "1.8.2"
once_cell = "1.21.3"
console = "0.15.11"
rayon = "1.10.0"
r2d2_sqlite = "0.30.0"
r2d2 = "0.8.10"