Skip to main content

SqlHostState

Struct SqlHostState 

Source
pub struct SqlHostState { /* private fields */ }

Implementations§

Source§

impl SqlHostState

Source

pub fn new(db: Arc<SqlDB>) -> Self

Trait Implementations§

Source§

impl HasData for SqlHostState

Source§

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 more
Source§

impl Host for SqlHostState

Source§

async fn get_pool_state(&mut self) -> PoolState

Returns current pool state
Source§

impl Host for SqlHostState

Source§

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>

Decodes a 16-bit signed integer (SMALLINT) from results.
Source§

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>

Decodes a 32-bit signed integer (INTEGER) from results.
Source§

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>

Decodes a 64-bit signed integer (BIGINT) from results.
Source§

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>

Decodes a 32-bit float (REAL) from results.
Source§

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>

Decodes a 64-bit float (DOUBLE PRECISION) from results.
Source§

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>

Decodes a string (TEXT, VARCHAR, CHAR) from results.
Source§

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>

Decodes a boolean (BOOLEAN) from results.
Source§

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>

Decodes a JSON value as string (JSON, JSONB) from results.
Source§

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>

Decodes a UUID from results.
Source§

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>

Decodes an HSTORE value from results.
Source§

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>

Decodes a DATE value from results.
Source§

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>

Decodes a TIME value from results.
Source§

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>

Decodes a TIMESTAMP value from results.
Source§

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>

Decodes a TIMESTAMPTZ value from results.
Source§

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>

Decodes an INTERVAL value from results.
Source§

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>

Decodes an INET value from results.
Source§

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>

Decodes a CIDR value from results.
Source§

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>

Decodes a MACADDR value from results.
Source§

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>

Decodes a NUMERIC value from results.
Source§

impl HostConnection for SqlHostState

Source§

async fn drop(&mut self, rep: Resource<Connection>) -> Result<()>

Source§

async fn release(&mut self, _this: Resource<Connection>)

Explicitly releases the connection back to the pool. Consumes the connection resource.
Source§

impl HostConnectionWithStore for SqlHostState

Source§

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

Source§

fn row_count(&mut self, self_: Resource<QueryResults>) -> Result<u64, Error>

Returns the number of rows in the result set.
Source§

fn drop(&mut self, rep: Resource<QueryResults>) -> Result<()>

Source§

impl HostSqlArguments for SqlHostState

Source§

fn new(&mut self) -> Result<Resource<SqlArgumentsImpl>, Error>

Creates a new empty arguments container.
Source§

fn drop(&mut self, rep: Resource<SqlArguments>) -> Result<()>

Source§

impl HostTransaction for SqlHostState

Source§

async fn drop(&mut self, rep: Resource<Transaction>) -> Result<()>

Source§

impl HostTransactionWithStore for SqlHostState

Source§

async fn commit<T>( accessor: &Accessor<T, Self>, this: Resource<Transaction>, ) -> Result<(), Error>

Commits all changes made within this transaction. Consumes the transaction resource.
Source§

async fn rollback<T>( accessor: &Accessor<T, Self>, this: Resource<Transaction>, ) -> Result<(), Error>

Rolls back all changes made within this transaction. Consumes the transaction resource.
Source§

impl HostWithStore for SqlHostState

Source§

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>

Acquires a dedicated connection from the pool. Use this when you need multiple operations on the same connection.
Source§

impl HostWithStore for SqlHostState

Source§

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>

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>

Executes a raw SQL string without parameters. Use for DDL statements or when parameters are not needed.
Source§

impl Host for SqlHostState

Source§

impl Host for SqlHostState

Source§

impl Host for SqlHostState

Source§

impl Host for SqlHostState

Source§

impl Host for SqlHostState

Source§

impl Host for SqlHostState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<_T> HostQueryResultsWithStore for _T
where _T: HasData + ?Sized,

Source§

impl<_T> HostSqlArgumentsWithStore for _T
where _T: HasData + ?Sized,

Source§

impl<_T> HostWithStore for _T
where _T: HasData + ?Sized,

Source§

impl<_T> HostWithStore for _T

Source§

impl<_T> HostWithStore for _T

Source§

impl<_T> HostWithStore for _T

Source§

impl<_T> HostWithStore for _T
where _T: HasData + ?Sized,

Source§

impl<_T> HostWithStore for _T
where _T: HasData + ?Sized,