pub struct CsvForeignWrapper;Expand description
The CSV wrapper registers under the kind "csv":
CREATE SERVER srv FOREIGN DATA WRAPPER csv OPTIONS (base_path '/data/csv').
Trait Implementations§
Source§impl ForeignDataWrapper for CsvForeignWrapper
impl ForeignDataWrapper for CsvForeignWrapper
Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
Unique identifier for the wrapper kind (e.g. “csv”, “postgres”).
Matches the
FOREIGN DATA WRAPPER <name> clause in DDL.Source§fn build_server_state(
&self,
options: &FdwOptions,
) -> Result<Option<Arc<dyn WrapperState>>, FdwError>
fn build_server_state( &self, options: &FdwOptions, ) -> Result<Option<Arc<dyn WrapperState>>, FdwError>
Validate + materialise a server’s options. Called once on
CREATE SERVER and cached on ForeignServer. Wrappers that
don’t need per-server state return Ok(None).Source§fn scan(
&self,
server_state: Option<&Arc<dyn WrapperState>>,
table_options: &FdwOptions,
) -> Result<Vec<UnifiedRecord>, FdwError>
fn scan( &self, server_state: Option<&Arc<dyn WrapperState>>, table_options: &FdwOptions, ) -> Result<Vec<UnifiedRecord>, FdwError>
Stream rows from the foreign table.
table_options merges the
server’s options with the table’s options (table takes priority
on conflicts). filter is opaque to the wrapper unless it
advertises pushdown via supports_pushdown.Source§fn estimated_row_count(
&self,
server_state: Option<&Arc<dyn WrapperState>>,
table_options: &FdwOptions,
) -> Option<usize>
fn estimated_row_count( &self, server_state: Option<&Arc<dyn WrapperState>>, table_options: &FdwOptions, ) -> Option<usize>
Estimated row count — drives planner cost.
None means the
wrapper has no cheap way to estimate and the planner falls back
to its default assumption.Source§fn supports_pushdown(&self) -> bool
fn supports_pushdown(&self) -> bool
Whether the wrapper can evaluate a SQL WHERE predicate natively.
When true, the planner will hand the AST to
scan_with_filter;
when false, the runtime applies the filter after the scan.Auto Trait Implementations§
impl Freeze for CsvForeignWrapper
impl RefUnwindSafe for CsvForeignWrapper
impl Send for CsvForeignWrapper
impl Sync for CsvForeignWrapper
impl Unpin for CsvForeignWrapper
impl UnsafeUnpin for CsvForeignWrapper
impl UnwindSafe for CsvForeignWrapper
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
Wrap the input message
T in a tonic::Request