ctb_storage/models.rs
1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
20//! Models can be called by other crates, not just storage crate. They abstract
21//! away the process of querying the database. The actual query building all
22//! happens in the storage singleton service. The storage service holds any
23//! active session tokens to access the tenant databases. So, keeping the SQL
24//! isolated within the storage service prevents a different compromised
25//! process (for instance a runtime process) running arbitrary queries or
26//! accessing users' data other than its own.
27
28pub mod graph;
29pub mod node;
30pub mod sync;
31pub mod user;
32
33pub mod graph_impl;
34pub mod node_impl;
35pub mod sync_impl;
36pub mod user_impl;