pub struct PgEngine { /* private fields */ }Expand description
PostgreSQL query engine that implements the Prax QueryEngine trait.
Implementations§
Trait Implementations§
Source§impl QueryEngine for PgEngine
impl QueryEngine for PgEngine
Source§fn query_many<T: Model + Send + 'static>(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Vec<T>>>
fn query_many<T: Model + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Vec<T>>>
Execute a SELECT query and return rows.
Source§fn query_one<T: Model + Send + 'static>(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<T>>
fn query_one<T: Model + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<T>>
Execute a SELECT query expecting one result.
Source§fn query_optional<T: Model + Send + 'static>(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Option<T>>>
fn query_optional<T: Model + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Option<T>>>
Execute a SELECT query expecting zero or one result.
Source§fn execute_insert<T: Model + Send + 'static>(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<T>>
fn execute_insert<T: Model + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<T>>
Execute an INSERT query and return the created row.
Source§fn execute_update<T: Model + Send + 'static>(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<Vec<T>>>
fn execute_update<T: Model + Send + 'static>( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<Vec<T>>>
Execute an UPDATE query and return affected rows.
Source§fn execute_delete(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn execute_delete( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Execute a DELETE query and return affected rows count.
Source§fn execute_raw(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn execute_raw( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Execute a raw SQL query.
Source§fn count(
&self,
sql: &str,
params: Vec<FilterValue>,
) -> BoxFuture<'_, QueryResult<u64>>
fn count( &self, sql: &str, params: Vec<FilterValue>, ) -> BoxFuture<'_, QueryResult<u64>>
Get a count of records.
Auto Trait Implementations§
impl Freeze for PgEngine
impl !RefUnwindSafe for PgEngine
impl Send for PgEngine
impl Sync for PgEngine
impl Unpin for PgEngine
impl !UnwindSafe for PgEngine
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