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)],
) -> Result<Row, Error>where
T: ToStatement,
pub async fn query<T>(
&self,
statement: impl IntoStatement<T>,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<Row>, Error>where
T: ToStatement,
pub async fn query_opt<T>(
&self,
statement: impl IntoStatement<T>,
params: &[&(dyn ToSql + Sync)],
) -> Result<Option<Row>, Error>where
T: ToStatement,
pub async fn execute<T>(
&self,
statement: impl IntoStatement<T>,
params: &[&(dyn ToSql + Sync)],
) -> Result<u64, Error>where
T: ToStatement,
pub async fn prepare(&self, query: impl AsRef<str>) -> Result<Statement, Error>
pub fn sql(&self, query: impl Into<String>) -> Sql
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pg
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