Skip to main content

Source

Trait Source 

Source
pub trait Source: Send {
    // Required methods
    fn export(
        &mut self,
        request: &ExportRequest<'_>,
        sink: &mut dyn BatchSink,
    ) -> Result<()>;
    fn query_scalar(&mut self, sql: &str) -> Result<Option<String>>;
    fn type_mappings(
        &mut self,
        query: &str,
        column_overrides: &ColumnOverrides,
    ) -> Result<Vec<TypeMapping>>;
}

Required Methods§

Source

fn export( &mut self, request: &ExportRequest<'_>, sink: &mut dyn BatchSink, ) -> Result<()>

Execute request.query and stream batches into sink.

Source

fn query_scalar(&mut self, sql: &str) -> Result<Option<String>>

Source

fn type_mappings( &mut self, query: &str, column_overrides: &ColumnOverrides, ) -> Result<Vec<TypeMapping>>

Return TypeMapping for every column in query without fetching rows.

Used by rivet check --type-report to show the full type provenance (source native type → RivetType → Arrow type → fidelity) before export. Implementations execute SELECT * FROM (...) AS _q LIMIT 0 so only server-side type metadata is transferred.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§