wb_cache/test/simulation/db/
entity.rs

1//! Models used in the simulation test suite.
2//!
3//! # Implementation note.
4//!
5//! For each model in this module, there is a corresponding `Manager` type that provides basic convenience methods
6//! and implements the [`crate::traits::DataController`] trait.
7pub mod customer;
8pub mod inventory_record;
9pub mod order;
10pub mod product;
11pub mod session;
12
13pub use customer::Entity as Customers;
14pub use customer::Manager as CustomerMgr;
15pub use customer::Model as Customer;
16pub use inventory_record::Entity as InventoryRecords;
17pub use inventory_record::Manager as InventoryRecordMgr;
18pub use inventory_record::Model as InventoryRecord;
19pub use order::Entity as Orders;
20pub use order::Manager as OrderMgr;
21pub use order::Model as Order;
22pub use product::Entity as Products;
23pub use product::Manager as ProductMgr;
24pub use product::Model as Product;
25pub use session::Entity as Sessions;
26pub use session::Manager as SessionMgr;
27pub use session::Model as Session;
28
29use crate::test::simulation::types::simerr;
30use crate::test::simulation::types::SimErrorAny;
31
32// Generate an error when a manager object accidentally holds a weak reference to
33// a DB provider that has zero strong references. This scenario should not occur
34// under normal circumstances, except in the case of a severe internal error.
35#[inline(always)]
36pub(crate) fn dbcp_gone(who: &str) -> SimErrorAny {
37    simerr!("({who}) Database Provider object (parent) is gone")
38}