perf(issue#6): migrate ShareFsRepository to PostgreSQL

- Add storage.shares table with indexes on token, (item_id, item_type), created_by
- Create SharePgRepository with indexed SQL queries and window-function pagination
- Rewire DI to inject SharePgRepository with PgPool instead of config
- Delete legacy share_fs_repository.rs (295 lines of JSON file I/O)
- Remove dead module declaration from repositories/mod.rs

Eliminates O(n) full-file JSON reads/writes, TOCTOU races, and crash
corruption risk. All share operations now use indexed PG queries.
This commit is contained in:
Dionisio
2026-02-24 10:09:49 +01:00
parent cba34056dc
commit b0235e05c8
6 changed files with 338 additions and 290 deletions
@@ -8,6 +8,7 @@ mod favorites_pg_repository;
mod recent_items_pg_repository;
mod session_pg_repository;
mod settings_pg_repository;
mod share_pg_repository;
mod transaction_utils;
mod user_pg_repository;
@@ -30,5 +31,6 @@ pub use folder_db_repository::FolderDbRepository;
pub use recent_items_pg_repository::RecentItemsPgRepository;
pub use session_pg_repository::SessionPgRepository;
pub use settings_pg_repository::SettingsPgRepository;
pub use share_pg_repository::SharePgRepository;
pub use trash_db_repository::TrashDbRepository;
pub use user_pg_repository::UserPgRepository;