27 lines
527 B
Rust
27 lines
527 B
Rust
mod bid_dao;
|
|
mod listing_dao;
|
|
mod user_dao;
|
|
|
|
// Re-export DAO structs for easy access
|
|
pub use bid_dao::BidDAO;
|
|
pub use listing_dao::ListingDAO;
|
|
use sqlx::SqlitePool;
|
|
pub use user_dao::UserDAO;
|
|
|
|
#[derive(Clone)]
|
|
pub struct DAOs {
|
|
pub user: UserDAO,
|
|
pub listing: ListingDAO,
|
|
pub bid: BidDAO,
|
|
}
|
|
|
|
impl DAOs {
|
|
pub fn new(pool: SqlitePool) -> Self {
|
|
Self {
|
|
user: UserDAO::new(pool.clone()),
|
|
listing: ListingDAO::new(pool.clone()),
|
|
bid: BidDAO::new(pool),
|
|
}
|
|
}
|
|
}
|