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;
|
2026-08-23 14:33:27 +02:00
|
|
|
pub mod blob_reference_sources;
|
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-06-18 13:29:41 +02:00
|
|
|
mod drive_pg_repository;
|
2026-06-24 23:52:01 -06:00
|
|
|
mod external_mount_repository;
|
2026-06-19 11:37:17 +00:00
|
|
|
mod face_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-06-01 21:57:07 +02:00
|
|
|
mod magic_link_token_pg_repository;
|
2026-03-04 14:02:15 +01:00
|
|
|
mod nextcloud_object_id_repository;
|
2026-07-26 23:01:07 +02:00
|
|
|
mod opaque_pg_repository;
|
2026-04-08 15:14:03 +03:00
|
|
|
pub mod playlist_pg_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;
|
2026-05-30 23:35:47 +02:00
|
|
|
mod subject_group_pg_repository;
|
2026-06-10 22:03:49 +02:00
|
|
|
pub(crate) 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-06-18 13:29:41 +02:00
|
|
|
pub use drive_pg_repository::DrivePgRepository;
|
2026-06-24 23:52:01 -06:00
|
|
|
pub use external_mount_repository::ExternalMountPgRepository;
|
2026-06-19 11:37:17 +00:00
|
|
|
pub use face_pg_repository::FacePgRepository;
|
2026-02-08 13:40:23 +01:00
|
|
|
pub use favorites_pg_repository::FavoritesPgRepository;
|
2026-02-14 17:54:25 +01:00
|
|
|
pub use file_blob_read_repository::FileBlobReadRepository;
|
|
|
|
|
pub use file_blob_write_repository::FileBlobWriteRepository;
|
2026-03-05 14:46:30 -05:00
|
|
|
pub use file_metadata_repository::FileMetadataRepository;
|
2026-02-14 17:54:25 +01:00
|
|
|
pub use folder_db_repository::FolderDbRepository;
|
2026-06-01 21:57:07 +02:00
|
|
|
pub use magic_link_token_pg_repository::MagicLinkTokenPgRepository;
|
2026-03-04 14:02:15 +01:00
|
|
|
pub use nextcloud_object_id_repository::NextcloudObjectIdRepository;
|
2026-07-26 23:01:07 +02:00
|
|
|
pub use opaque_pg_repository::OpaquePgRepository;
|
2026-04-08 15:14:03 +03:00
|
|
|
pub use playlist_pg_repository::{
|
|
|
|
|
AudioMetadataPgRepository, PlaylistItemPgRepository, PlaylistPgRepository,
|
|
|
|
|
};
|
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-05-30 23:35:47 +02:00
|
|
|
pub use subject_group_pg_repository::SubjectGroupPgRepository;
|
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}%")
|
|
|
|
|
}
|