Skip to main content

BindInfo

Struct BindInfo 

Source
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

Source

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.

Source

pub fn parameter_count(&self) -> u64

The number of positional parameters passed to this call of the function.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.