Struct pg_worm::config::Connection
source · pub struct Connection;Expand description
An empty struct that only provides the build method.
Implementations§
source§impl Connection
impl Connection
sourcepub fn build(connection_string: impl Into<String>) -> ConnectionBuilder<NoTls>
pub fn build(connection_string: impl Into<String>) -> ConnectionBuilder<NoTls>
Start building a new connection (pool).
This returns a ConnectionBuilder which can be configured
using the builder pattern.
If you are fine with the default configuration
(max_pool_size = num_cpus * 4 and no Tls) or have
configured to your needs you can finish the setup
by calling .connect().
A connection must be created before executing any queries or the like. Doing otherwise will result in a runime error.
Example
ⓘ
use pg_worm::prelude::*;
Connection::build("postgres://postgres").connect()?; Auto Trait Implementations§
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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