pub struct PreparedStatementBinding {
pub statement_id: StatementId,
pub sql: String,
pub parameter_types: Vec<String>,
pub catalog_version: MetadataVersion,
pub schema_versions: BTreeMap<TableId, SchemaVersion>,
pub feature_set: BTreeSet<String>,
}Expand description
Everything a prepared plan binds to (S1D-005).
The binding is data only: the plan itself is server state. Executors call
Self::is_compatible before every execution and invalidate + replan on
false; a stale plan never executes silently.
Fields§
§statement_id: StatementIdSession-scoped handle of this prepared statement.
sql: StringThe SQL text the plan was built from.
parameter_types: Vec<String>Canonical parameter type names in statement order (see
crate::request::ParameterValue::type_name); execution with a
mismatched parameter list fails rather than coercing silently.
catalog_version: MetadataVersionCatalog metadata version the plan was built against.
schema_versions: BTreeMap<TableId, SchemaVersion>Schema version of every table the plan touches, keyed by table.
feature_set: BTreeSet<String>The negotiated engine feature set the plan relies on. Feature-set
changes are negotiated at session (re)handshake, not per request, so
Self::is_compatible does not re-check them; a session whose
feature set changed re-prepares all of its statements.
Implementations§
Source§impl PreparedStatementBinding
impl PreparedStatementBinding
Sourcepub fn is_compatible(
&self,
catalog_version: MetadataVersion,
schema_versions: &BTreeMap<TableId, SchemaVersion>,
) -> bool
pub fn is_compatible( &self, catalog_version: MetadataVersion, schema_versions: &BTreeMap<TableId, SchemaVersion>, ) -> bool
Whether the plan is still valid against the current catalog state.
Compatible iff the catalog version is unchanged AND every table the plan touches still exists at exactly the schema version it was planned against. Tables the plan does not touch may change freely.
On false the statement MUST be invalidated and replanned (S1D-005):
a stale plan never executes silently.
Trait Implementations§
Source§impl Clone for PreparedStatementBinding
impl Clone for PreparedStatementBinding
Source§fn clone(&self) -> PreparedStatementBinding
fn clone(&self) -> PreparedStatementBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PreparedStatementBinding
impl Debug for PreparedStatementBinding
Source§impl<'de> Deserialize<'de> for PreparedStatementBinding
impl<'de> Deserialize<'de> for PreparedStatementBinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PreparedStatementBinding
Source§impl PartialEq for PreparedStatementBinding
impl PartialEq for PreparedStatementBinding
Source§impl Serialize for PreparedStatementBinding
impl Serialize for PreparedStatementBinding
impl StructuralPartialEq for PreparedStatementBinding
Auto Trait Implementations§
impl Freeze for PreparedStatementBinding
impl RefUnwindSafe for PreparedStatementBinding
impl Send for PreparedStatementBinding
impl Sync for PreparedStatementBinding
impl Unpin for PreparedStatementBinding
impl UnsafeUnpin for PreparedStatementBinding
impl UnwindSafe for PreparedStatementBinding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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