Something went wrong. Try again.
A fork of @slices.network/slices forked from slices.network/slices
Something went wrong. Try again.
123456789101112131415161718192021222324use sqlx::PgPool;
/// Core database client for interacting with PostgreSQL.////// The Database struct wraps a connection pool and provides methods for/// all database operations across records, actors, slices, OAuth, and analytics.#[derive(Clone)]pub struct Database { pub(super) pool: PgPool,}
impl Database { /// Creates a new Database instance from a connection pool. pub fn new(pool: PgPool) -> Self { Self { pool } }
/// Creates a new Database instance from a connection pool. /// Alias for `new()` for clarity in some contexts. pub fn from_pool(pool: PgPool) -> Self { Self::new(pool) }}