Skip to main content

webdav_server/model/
mod.rs

1//! Database entity definitions and query functions.
2//!
3//! This module contains the data model for every entity stored in the `SQLite` database.
4//! Each sub-module corresponds to one table and owns the query functions that operate
5//! on that table. All query functions accept a [`sqlx::SqlitePool`] reference rather than
6//! taking ownership, so they can be called freely from any async context.
7//!
8//! ## Sub-modules
9//!
10//! - [`asset`] — The `assets` table. Tracks which users own which blobs (CAS hashes).
11//!   Implements reference-counted deletion: the physical file is only removed when the
12//!   last ownership row is deleted.
13//! - [`session`] — The `sessions` table. Manages opaque session tokens with a 30-day TTL.
14//! - [`user`] — The `users` table. Stores hashed identities and authentication verifiers.
15//! - [`error`] — The `model::Error` type covering all database-layer failures.
16pub mod asset;
17pub mod error;
18pub mod session;
19pub mod user;
20
21pub use error::{Error, Result};