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 Freeze for Connection
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