pub struct Orm;Expand description
Orm configuration structure
Implementations§
Source§impl Orm
impl Orm
Sourcepub async fn init(database_url: &str) -> Result<(), Error>
pub async fn init(database_url: &str) -> Result<(), Error>
Initialize the global database connection pool using an agnostic URI
Sourcepub async fn init_with_replicas(
primary_url: &str,
replica_urls: Vec<&str>,
) -> Result<(), Error>
pub async fn init_with_replicas( primary_url: &str, replica_urls: Vec<&str>, ) -> Result<(), Error>
Initialize the global database connection pool and its read replicas
Sourcepub fn pool() -> &'static RullstPool
pub fn pool() -> &'static RullstPool
Retrieve the global database connection pool (strictly for writes)
Sourcepub fn read_pool() -> &'static RullstPool
pub fn read_pool() -> &'static RullstPool
Retrieve the connection pool for read operations. Performs a round-robin load balancing over replicas if configured.
pub async fn begin_transaction() -> Result<Transaction<'static>, Error>
Sourcepub async fn seed(seeders: Vec<Box<dyn Seeder>>) -> Result<(), Error>
pub async fn seed(seeders: Vec<Box<dyn Seeder>>) -> Result<(), Error>
Run an array of seeders sequentially
Sourcepub fn enable_query_log()
pub fn enable_query_log()
Enable query logging to print all queries to the terminal
Sourcepub fn disable_query_log()
pub fn disable_query_log()
Disable query logging
Auto Trait Implementations§
impl Freeze for Orm
impl RefUnwindSafe for Orm
impl Send for Orm
impl Sync for Orm
impl Unpin for Orm
impl UnsafeUnpin for Orm
impl UnwindSafe for Orm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more