pub struct Pg(/* private fields */);
Implementations§
source§impl Pg
impl Pg
pub fn new(uri: impl Into<String>) -> Pg
pub fn new_with_env(env: impl Into<String>) -> Pg
pub async fn query_one<T>( &self, statement: impl IntoStatement<T>, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Row, Error>>where T: ToStatement,
pub async fn query<T>( &self, statement: impl IntoStatement<T>, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Vec<Row, Global>, Error>>where T: ToStatement,
pub async fn query_opt<T>( &self, statement: impl IntoStatement<T>, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<Option<Row>, Error>>where T: ToStatement,
pub async fn execute<T>( &self, statement: impl IntoStatement<T>, params: &[&(dyn ToSql + Sync)] ) -> impl Future<Output = Result<u64, Error>>where T: ToStatement,
pub async fn prepare( &self, query: impl AsRef<str> ) -> impl Future<Output = Result<Statement, Error>>
pub fn sql(&self, query: impl Into<String>) -> Sql
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Pg
impl Send for Pg
impl Sync for Pg
impl Unpin for Pg
impl !UnwindSafe for Pg
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