pub struct PreparedRegistry { /* private fields */ }Expand description
Connection-owned prepared-statement state. A registry must not be shared between logical connections; IDs resolve only in the instance that minted them.
Implementations§
Source§impl PreparedRegistry
impl PreparedRegistry
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a connection-scoped registry bounded to 1,024 entries. Once full, preparing a query evicts the oldest prepared ID.
Sourcepub fn with_capacity(capacity: usize) -> RedDBResult<Self>
pub fn with_capacity(capacity: usize) -> RedDBResult<Self>
Build a connection-scoped registry with oldest-ID eviction at capacity.
Sourcepub fn prepare(
&self,
runtime: &RedDBRuntime,
sql: &str,
) -> RedDBResult<PreparedQuery>
pub fn prepare( &self, runtime: &RedDBRuntime, sql: &str, ) -> RedDBResult<PreparedQuery>
Prepare a statement whose parameters are the client’s $N
placeholders (ADR 0015).
Sourcepub fn prepare_auto_parameterized(
&self,
runtime: &RedDBRuntime,
sql: &str,
) -> RedDBResult<PreparedQuery>
pub fn prepare_auto_parameterized( &self, runtime: &RedDBRuntime, sql: &str, ) -> RedDBResult<PreparedQuery>
Prepare a statement whose parameters are the planner’s
auto-parameterized literals instead of $N placeholders.
The legacy binary protocol reports WHERE id = 5 as one parameter in
PREPARED_OK and its clients bind positionally against that count, so
the wire prepares through here. prepare stays the entry point for
transports that speak ADR 0015 placeholders.
Sourcepub fn disable(&self)
pub fn disable(&self)
One-way emergency kill switch. Existing entries stay allocated but cannot be prepared or executed after this call.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether prepared statements are still served on this connection. Transports gate their handlers on this so the kill switch keeps its own wire error text instead of inheriting an execution error’s.
Sourcepub fn ddl_epoch(&self, id: PreparedId) -> Option<u64>
pub fn ddl_epoch(&self, id: PreparedId) -> Option<u64>
DDL epoch captured when id was prepared, or None when the entry is
gone. Transports check it themselves to keep the wire’s
prepared_needs_replan precedence ahead of their arity check.
Sourcepub fn release(&self, id: PreparedId)
pub fn release(&self, id: PreparedId)
Drop a prepared entry — DEALLOCATE frees the shape, not just the transport’s wire-id mapping.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PreparedRegistry
impl !RefUnwindSafe for PreparedRegistry
impl Send for PreparedRegistry
impl Sync for PreparedRegistry
impl Unpin for PreparedRegistry
impl UnsafeUnpin for PreparedRegistry
impl UnwindSafe for PreparedRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request