pub struct PSConnection {
pub session: Arc<Mutex<Option<Session>>>,
pub client: Client,
/* private fields */
}
Fields§
§session: Arc<Mutex<Option<Session>>>
§client: Client
Implementations§
Source§impl PSConnection
impl PSConnection
Sourcepub fn new_from_env() -> Result<Self>
pub fn new_from_env() -> Result<Self>
Creates a new connection from the environment variables (DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD)
Sourcepub async fn execute_raw(&self, query: &str) -> Result<ExecuteResponse>
pub async fn execute_raw(&self, query: &str) -> Result<ExecuteResponse>
Execute a SQL query and return the raw response
Sourcepub async fn transaction<F, Fut>(&self, f: F) -> Result<()>
pub async fn transaction<F, Fut>(&self, f: F) -> Result<()>
As the name suggests, this function is making a transaction
Trait Implementations§
Source§impl Clone for PSConnection
impl Clone for PSConnection
Source§fn clone(&self) -> PSConnection
fn clone(&self) -> PSConnection
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PSConnection
impl !RefUnwindSafe for PSConnection
impl Send for PSConnection
impl Sync for PSConnection
impl Unpin for PSConnection
impl !UnwindSafe for PSConnection
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