Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required methods
    fn open(
        &mut self,
        connection: &Map<String, Value>,
        read_only: bool,
    ) -> Result<()>;
    fn execute(
        &mut self,
        sql: &str,
        row_limit: Option<u64>,
        out: &mut dyn ResultSink,
    ) -> Result<()>;

    // Provided methods
    fn connection_fields(&self) -> Vec<ConnectionField> { ... }
    fn check(&mut self, _sql: &str) -> Result<()> { ... }
    fn load(&mut self, _name: &str, _data: &mut ResultSet<'_>) -> Result<Loaded> { ... }
    fn close(&mut self) { ... }
}

Required Methods§

Source

fn open( &mut self, connection: &Map<String, Value>, read_only: bool, ) -> Result<()>

Source

fn execute( &mut self, sql: &str, row_limit: Option<u64>, out: &mut dyn ResultSink, ) -> Result<()>

Run one statement. row_limit is a hint; the SDK enforces it either way.

Provided Methods§

Source

fn connection_fields(&self) -> Vec<ConnectionField>

Source

fn check(&mut self, _sql: &str) -> Result<()>

Verify without executing. Only called when the plugin advertises check.

Source

fn load(&mut self, _name: &str, _data: &mut ResultSet<'_>) -> Result<Loaded>

Load data into a temporary table on the session, named after name. Only called when the plugin advertises load.

Source

fn close(&mut self)

End the session cleanly (called on close and at end of input, before exiting).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§