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 more