pub struct ExtractedStatements { /* private fields */ }Expand description
A parsed batch of SQL statements, each preparable on demand. A parsed batch of SQL statements, each preparable on demand.
Produced by Connection::extract_statements.
Owns the
duckdb_extracted_statements handle and destroys it in Drop; it retains
the connection it parsed against (Arc<ConnectionInner>) so a statement
prepared from it cannot outlive that connection — the same ownership rule as
CachedStatement.
Implementations§
Source§impl ExtractedStatements
impl ExtractedStatements
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if no statements were parsed.
Always false in practice — a zero-statement extract is reported as an
error at extraction time — but provided so the
type satisfies the usual len/is_empty pairing.
Sourcepub fn prepare(&self, index: u64) -> Result<CachedStatement>
pub fn prepare(&self, index: u64) -> Result<CachedStatement>
Prepares the extracted statement at index (0-based), reusing the ordinary
CachedStatement wrapper.
§Errors
Error::DuckDBFailure if index is out of range, or if DuckDB fails to
prepare the statement.