2025-04-13 01:04:04 +02:00
|
|
|
mod address_book_pg_repository;
|
2026-03-01 20:34:12 +01:00
|
|
|
mod app_password_pg_repository;
|
2025-04-13 01:04:04 +02:00
|
|
|
mod calendar_event_pg_repository;
|
2026-02-14 01:29:34 +01:00
|
|
|
mod calendar_pg_repository;
|
2026-02-10 18:46:59 +01:00
|
|
|
mod contact_group_pg_repository;
|
2026-02-02 23:56:40 +01:00
|
|
|
mod contact_persistence_dto;
|
2026-02-14 01:29:34 +01:00
|
|
|
mod contact_pg_repository;
|
2026-03-01 11:54:43 +01:00
|
|
|
mod device_code_pg_repository;
|
2026-02-08 13:40:23 +01:00
|
|
|
mod favorites_pg_repository;
|
2026-03-05 12:48:47 -05:00
|
|
|
pub mod file_metadata_repository;
|
2026-03-04 14:02:15 +01:00
|
|
|
mod nextcloud_object_id_repository;
|
2026-02-08 13:40:23 +01:00
|
|
|
mod recent_items_pg_repository;
|
2025-03-20 09:22:31 +01:00
|
|
|
mod session_pg_repository;
|
2026-02-11 00:15:26 +01:00
|
|
|
mod settings_pg_repository;
|
2026-02-24 10:09:49 +01:00
|
|
|
mod share_pg_repository;
|
2025-04-09 00:21:20 +02:00
|
|
|
mod transaction_utils;
|
2025-04-13 01:04:04 +02:00
|
|
|
mod user_pg_repository;
|
2025-03-20 09:22:31 +01:00
|
|
|
|
2026-02-14 17:54:25 +01:00
|
|
|
// ── Blob-storage repositories ──
|
|
|
|
|
pub mod file_blob_read_repository;
|
|
|
|
|
pub mod file_blob_write_repository;
|
|
|
|
|
pub mod folder_db_repository;
|
|
|
|
|
pub mod trash_db_repository;
|
|
|
|
|
|
2025-04-13 01:04:04 +02:00
|
|
|
pub use address_book_pg_repository::AddressBookPgRepository;
|
2026-03-01 20:34:12 +01:00
|
|
|
pub use app_password_pg_repository::AppPasswordPgRepository;
|
2025-04-13 01:04:04 +02:00
|
|
|
pub use calendar_event_pg_repository::CalendarEventPgRepository;
|
2026-02-14 01:29:34 +01:00
|
|
|
pub use calendar_pg_repository::CalendarPgRepository;
|
2026-02-10 18:46:59 +01:00
|
|
|
pub use contact_group_pg_repository::ContactGroupPgRepository;
|
2026-02-02 23:56:40 +01:00
|
|
|
pub use contact_persistence_dto::*;
|
2026-02-14 01:29:34 +01:00
|
|
|
pub use contact_pg_repository::ContactPgRepository;
|
2026-03-01 11:54:43 +01:00
|
|
|
pub use device_code_pg_repository::DeviceCodePgRepository;
|
2026-02-08 13:40:23 +01:00
|
|
|
pub use favorites_pg_repository::FavoritesPgRepository;
|
2026-03-05 12:48:47 -05:00
|
|
|
pub use file_metadata_repository::FileMetadataRepository;
|
2026-02-14 17:54:25 +01:00
|
|
|
pub use file_blob_read_repository::FileBlobReadRepository;
|
|
|
|
|
pub use file_blob_write_repository::FileBlobWriteRepository;
|
|
|
|
|
pub use folder_db_repository::FolderDbRepository;
|
2026-03-04 14:02:15 +01:00
|
|
|
pub use nextcloud_object_id_repository::NextcloudObjectIdRepository;
|
2026-02-08 13:40:23 +01:00
|
|
|
pub use recent_items_pg_repository::RecentItemsPgRepository;
|
2025-04-09 00:21:20 +02:00
|
|
|
pub use session_pg_repository::SessionPgRepository;
|
2026-02-11 00:15:26 +01:00
|
|
|
pub use settings_pg_repository::SettingsPgRepository;
|
2026-02-24 10:09:49 +01:00
|
|
|
pub use share_pg_repository::SharePgRepository;
|
2026-02-14 17:54:25 +01:00
|
|
|
pub use trash_db_repository::TrashDbRepository;
|
2025-04-13 01:04:04 +02:00
|
|
|
pub use user_pg_repository::UserPgRepository;
|
2026-03-05 14:52:11 +01:00
|
|
|
|
|
|
|
|
// ── SQL helpers ─────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
/// Escape SQL `LIKE` / `ILIKE` wildcard characters (`%` and `_`) in user
|
|
|
|
|
/// input and wrap the result in `%…%` for a contains-match.
|
|
|
|
|
///
|
|
|
|
|
/// Without this, a user searching for `100%` would match *every* row because
|
|
|
|
|
/// `%` is a wildcard in LIKE patterns.
|
|
|
|
|
#[inline]
|
|
|
|
|
pub fn like_escape(raw: &str) -> String {
|
2026-03-05 21:28:51 +01:00
|
|
|
let escaped = raw
|
|
|
|
|
.replace('\\', "\\\\")
|
|
|
|
|
.replace('%', "\\%")
|
|
|
|
|
.replace('_', "\\_");
|
2026-03-05 14:52:11 +01:00
|
|
|
format!("%{escaped}%")
|
|
|
|
|
}
|