pub struct SqlSession { /* private fields */ }Expand description
One SQL environment over a fixed immutable database view.
Implementations§
Source§impl SqlSession
impl SqlSession
Sourcepub async fn query(&self, sql: &str) -> Result<SqlQuery, SqlError>
pub async fn query(&self, sql: &str) -> Result<SqlQuery, SqlError>
Plans and starts a read-only SQL query.
DDL, DML, and session-mutating statements are rejected by this method;
use Self::mutation to plan supported DML. Dropping the
returned stream cancels unfinished execution.
§Errors
Returns SqlError for SQL parsing, planning, or execution failure.
Sourcepub async fn query_params(
&self,
sql: &str,
params: &[SqlValue],
) -> Result<SqlQuery, SqlError>
pub async fn query_params( &self, sql: &str, params: &[SqlValue], ) -> Result<SqlQuery, SqlError>
Sourcepub async fn mutation(&self, sql: &str) -> Result<Option<SqlMutation>, SqlError>
pub async fn mutation(&self, sql: &str) -> Result<Option<SqlMutation>, SqlError>
Plans one supported INSERT, UPDATE, or DELETE into Corium
transaction forms. Returns None for read-only statements.
The returned mutation is fenced to this session’s basis. Its forms
must be submitted through the normal transactor path and then
SqlMutation::finish called with the committed database value and
tempid map to produce any RETURNING rows.
§Errors
Returns SqlError for malformed or unsupported mutation shapes.
Sourcepub async fn mutation_params(
&self,
sql: &str,
params: &[SqlValue],
) -> Result<Option<SqlMutation>, SqlError>
pub async fn mutation_params( &self, sql: &str, params: &[SqlValue], ) -> Result<Option<SqlMutation>, SqlError>
Auto Trait Implementations§
impl !RefUnwindSafe for SqlSession
impl !UnwindSafe for SqlSession
impl Freeze for SqlSession
impl Send for SqlSession
impl Sync for SqlSession
impl Unpin for SqlSession
impl UnsafeUnpin for SqlSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more