pub struct SqlHostState { /* private fields */ }Implementations§
Trait Implementations§
Source§impl HasData for SqlHostState
impl HasData for SqlHostState
Source§type Data<'a> = &'a mut SqlHostState
where
Self: 'a
type Data<'a> = &'a mut SqlHostState where Self: 'a
The data associated with this trait implementation, chiefly used as a
generic associated type to allow plumbing the
'a lifetime into the
definition here. Read moreSource§impl Host for SqlHostState
impl Host for SqlHostState
Source§async fn get_pool_state(&mut self) -> PoolState
async fn get_pool_state(&mut self) -> PoolState
Returns current pool state
Source§impl Host for SqlHostState
impl Host for SqlHostState
Source§fn push_int16(
&mut self,
value: Option<i16>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_int16( &mut self, value: Option<i16>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a 16-bit signed integer (SMALLINT).
Source§fn get_int16(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<i16>, Error>
fn get_int16( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<i16>, Error>
Decodes a 16-bit signed integer (SMALLINT) from results.
Source§fn push_int32(
&mut self,
value: Option<i32>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_int32( &mut self, value: Option<i32>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a 32-bit signed integer (INTEGER).
Source§fn get_int32(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<i32>, Error>
fn get_int32( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<i32>, Error>
Decodes a 32-bit signed integer (INTEGER) from results.
Source§fn push_int64(
&mut self,
value: Option<i64>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_int64( &mut self, value: Option<i64>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a 64-bit signed integer (BIGINT).
Source§fn get_int64(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<i64>, Error>
fn get_int64( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<i64>, Error>
Decodes a 64-bit signed integer (BIGINT) from results.
Source§fn push_float32(
&mut self,
value: Option<f32>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_float32( &mut self, value: Option<f32>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a 32-bit float (REAL).
Source§fn get_float32(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<f32>, Error>
fn get_float32( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<f32>, Error>
Decodes a 32-bit float (REAL) from results.
Source§fn push_float64(
&mut self,
value: Option<f64>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_float64( &mut self, value: Option<f64>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a 64-bit float (DOUBLE PRECISION).
Source§fn get_float64(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<f64>, Error>
fn get_float64( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<f64>, Error>
Decodes a 64-bit float (DOUBLE PRECISION) from results.
Source§fn push_string(
&mut self,
value: Option<String>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_string( &mut self, value: Option<String>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a string (TEXT, VARCHAR, CHAR).
Source§fn get_string(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<String>, Error>
fn get_string( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<String>, Error>
Decodes a string (TEXT, VARCHAR, CHAR) from results.
Source§fn push_bool(
&mut self,
value: Option<bool>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_bool( &mut self, value: Option<bool>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a boolean (BOOLEAN).
Source§fn get_bool(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<bool>, Error>
fn get_bool( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<bool>, Error>
Decodes a boolean (BOOLEAN) from results.
Source§fn push_json(
&mut self,
value: Option<String>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_json( &mut self, value: Option<String>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a JSON value as string (JSON, JSONB).
Source§fn get_json(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<String>, Error>
fn get_json( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<String>, Error>
Decodes a JSON value as string (JSON, JSONB) from results.
Source§fn push_uuid(
&mut self,
value: Option<Uuid>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_uuid( &mut self, value: Option<Uuid>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a UUID.
Source§fn get_uuid(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Uuid>, Error>
fn get_uuid( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Uuid>, Error>
Decodes a UUID from results.
Source§fn push_hstore(
&mut self,
value: Option<Hstore>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_hstore( &mut self, value: Option<Hstore>, to: Resource<SqlArguments>, ) -> PushResult
Encodes an HSTORE value.
Source§fn get_hstore(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Hstore>, Error>
fn get_hstore( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Hstore>, Error>
Decodes an HSTORE value from results.
Source§fn push_date(
&mut self,
value: Option<Date>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_date( &mut self, value: Option<Date>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a DATE value.
Source§fn get_date(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Date>, Error>
fn get_date( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Date>, Error>
Decodes a DATE value from results.
Source§fn push_time(
&mut self,
value: Option<Time>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_time( &mut self, value: Option<Time>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a TIME value.
Source§fn get_time(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Time>, Error>
fn get_time( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Time>, Error>
Decodes a TIME value from results.
Source§fn push_timestamp(
&mut self,
value: Option<Timestamp>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_timestamp( &mut self, value: Option<Timestamp>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a TIMESTAMP value.
Source§fn get_timestamp(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Timestamp>, Error>
fn get_timestamp( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Timestamp>, Error>
Decodes a TIMESTAMP value from results.
Source§fn push_timestamptz(
&mut self,
value: Option<Timestamptz>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_timestamptz( &mut self, value: Option<Timestamptz>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a TIMESTAMPTZ value.
Source§fn get_timestamptz(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Timestamptz>, Error>
fn get_timestamptz( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Timestamptz>, Error>
Decodes a TIMESTAMPTZ value from results.
Source§fn push_interval(
&mut self,
value: Option<PgInterval>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_interval( &mut self, value: Option<PgInterval>, to: Resource<SqlArguments>, ) -> PushResult
Encodes an INTERVAL value.
Source§fn get_interval(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<PgInterval>, Error>
fn get_interval( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<PgInterval>, Error>
Decodes an INTERVAL value from results.
Source§fn push_inet(
&mut self,
value: Option<Inet>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_inet( &mut self, value: Option<Inet>, to: Resource<SqlArguments>, ) -> PushResult
Encodes an INET value.
Source§fn get_inet(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Inet>, Error>
fn get_inet( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Inet>, Error>
Decodes an INET value from results.
Source§fn push_cidr(
&mut self,
value: Option<Inet>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_cidr( &mut self, value: Option<Inet>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a CIDR value.
Source§fn get_cidr(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Inet>, Error>
fn get_cidr( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Inet>, Error>
Decodes a CIDR value from results.
Source§fn push_macaddr(
&mut self,
value: Option<Macaddr>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_macaddr( &mut self, value: Option<Macaddr>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a MACADDR value.
Source§fn get_macaddr(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Macaddr>, Error>
fn get_macaddr( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Macaddr>, Error>
Decodes a MACADDR value from results.
Source§fn push_numeric(
&mut self,
value: Option<Numeric>,
to: Resource<SqlArguments>,
) -> PushResult
fn push_numeric( &mut self, value: Option<Numeric>, to: Resource<SqlArguments>, ) -> PushResult
Encodes a NUMERIC value.
Source§fn get_numeric(
&mut self,
result: Resource<QueryResults>,
position: ValuePosition,
) -> Result<Option<Numeric>, Error>
fn get_numeric( &mut self, result: Resource<QueryResults>, position: ValuePosition, ) -> Result<Option<Numeric>, Error>
Decodes a NUMERIC value from results.
Source§impl HostConnection for SqlHostState
impl HostConnection for SqlHostState
Source§impl HostConnectionWithStore for SqlHostState
impl HostConnectionWithStore for SqlHostState
Source§async fn begin_transaction<T>(
accessor: &Accessor<T, Self>,
self_: Resource<Connection>,
) -> Result<Resource<Transaction>, Error>
async fn begin_transaction<T>( accessor: &Accessor<T, Self>, self_: Resource<Connection>, ) -> Result<Resource<Transaction>, Error>
Begins a new transaction on this connection.
If dropped without explicit commit or rollback, the transaction is automatically rolled back.
Source§impl HostQueryResults for SqlHostState
impl HostQueryResults for SqlHostState
Source§impl HostSqlArguments for SqlHostState
impl HostSqlArguments for SqlHostState
Source§impl HostTransaction for SqlHostState
impl HostTransaction for SqlHostState
Source§impl HostTransactionWithStore for SqlHostState
impl HostTransactionWithStore for SqlHostState
Source§impl HostWithStore for SqlHostState
impl HostWithStore for SqlHostState
Source§async fn begin_transaction<T>(
accessor: &Accessor<T, Self>,
) -> Result<Resource<Transaction>, Error>
async fn begin_transaction<T>( accessor: &Accessor<T, Self>, ) -> Result<Resource<Transaction>, Error>
Begins a new transaction from the pool.
If dropped without explicit commit or rollback, the transaction is automatically rolled back.
Source§async fn acquire_connection<T>(
accessor: &Accessor<T, Self>,
) -> Result<Resource<Connection>, Error>
async fn acquire_connection<T>( accessor: &Accessor<T, Self>, ) -> Result<Resource<Connection>, Error>
Acquires a dedicated connection from the pool.
Use this when you need multiple operations on the same connection.
Source§impl HostWithStore for SqlHostState
impl HostWithStore for SqlHostState
Source§async fn fetch_all<T>(
accessor: &Accessor<T, Self>,
query: SqlQuery,
executor: QueryExecutor,
) -> Result<Resource<QueryResults>, Error>
async fn fetch_all<T>( accessor: &Accessor<T, Self>, query: SqlQuery, executor: QueryExecutor, ) -> Result<Resource<QueryResults>, Error>
Executes a SELECT query and returns all rows.
Use database-specific codecs to extract values from results.
Source§async fn execute<T>(
accessor: &Accessor<T, Self>,
query: SqlQuery,
executor: QueryExecutor,
) -> Result<u64, Error>
async fn execute<T>( accessor: &Accessor<T, Self>, query: SqlQuery, executor: QueryExecutor, ) -> Result<u64, Error>
Executes an INSERT, UPDATE, or DELETE query.
Returns the number of affected rows.
Source§async fn execute_raw<T>(
accessor: &Accessor<T, Self>,
query: SqlString,
executor: QueryExecutor,
) -> Result<(), Error>
async fn execute_raw<T>( accessor: &Accessor<T, Self>, query: SqlString, executor: QueryExecutor, ) -> Result<(), Error>
Executes a raw SQL string without parameters.
Use for DDL statements or when parameters are not needed.
impl Host for SqlHostState
impl Host for SqlHostState
impl Host for SqlHostState
impl Host for SqlHostState
impl Host for SqlHostState
impl Host for SqlHostState
Auto Trait Implementations§
impl Freeze for SqlHostState
impl !RefUnwindSafe for SqlHostState
impl Send for SqlHostState
impl !Sync for SqlHostState
impl Unpin for SqlHostState
impl UnsafeUnpin for SqlHostState
impl !UnwindSafe for SqlHostState
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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