pub struct BindInfo { /* private fields */ }Expand description
An interface to store and retrieve data during the table function’s bind stage.
Implementations§
Source§impl BindInfo
impl BindInfo
Sourcepub fn add_result_column(
&self,
column_name: &str,
column_type: &LogicalType,
) -> Result<()>
pub fn add_result_column( &self, column_name: &str, column_type: &LogicalType, ) -> Result<()>
Adds a result column to the output schema of the table function.
§Errors
Returns an error if column_name contains a NUL byte.
Sourcepub fn parameter_count(&self) -> u64
pub fn parameter_count(&self) -> u64
The number of positional parameters passed to this call of the function.
Sourcepub fn client_context(&self) -> Option<ClientContext<'_>>
pub fn client_context(&self) -> Option<ClientContext<'_>>
The ClientContext of the connection executing this bind, exposing its
stable connection id. The returned context borrows self, so it cannot
outlive the bind call. Returns None if no context is available.
Sourcepub fn get_parameter<T: DuckDialect>(&self, index: u64) -> Result<T>
pub fn get_parameter<T: DuckDialect>(&self, index: u64) -> Result<T>
Reads the positional parameter at index as T.
§Errors
Returns an error if index is out of range or the parameter cannot be
converted to T.
Sourcepub fn get_named_parameter<T: DuckDialect>(
&self,
name: &str,
) -> Result<Option<T>>
pub fn get_named_parameter<T: DuckDialect>( &self, name: &str, ) -> Result<Option<T>>
Reads the named (keyword) parameter name as T.
Unlike get_parameter, a missing named
parameter is not an error — named parameters are optional by nature —
so this returns Ok(None) when name wasn’t passed by the caller.
§Errors
Returns an error if name contains a NUL byte, or if the parameter was
provided but cannot be converted to T.
Sourcepub fn extra_info<T>(&self) -> Option<&T>
pub fn extra_info<T>(&self) -> Option<&T>
The registration-time “extra info” set via a table function’s
set_extra_info, if any, shared read-only across every call to
bind/init/func for this function.
Returns None if no extra info was configured for this function.
§Safety
The caller must request the same T that was stored at registration
time; there is no runtime type check.
Sourcepub fn set_cardinality(&self, cardinality: u64, is_exact: bool)
pub fn set_cardinality(&self, cardinality: u64, is_exact: bool)
Sets the estimated (or exact) number of rows this call will produce, used by the query optimizer.