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 identifier_quote(&self) -> Option<&'static str> { ... }
fn check(&mut self, _sql: &str) -> Result<()> { ... }
fn load(&mut self, _name: &str, _data: &mut ResultSet<'_>) -> Result<Loaded> { ... }
fn close(&mut self) { ... }
}Required Methods§
Provided Methods§
fn connection_fields(&self) -> Vec<ConnectionField>
Sourcefn identifier_quote(&self) -> Option<&'static str>
fn identifier_quote(&self) -> Option<&'static str>
The character the database quotes identifiers with, reported in describe: " for
most SQL databases, a backtick for Databricks and MySQL. Core doubles it inside a name.
Sourcefn check(&mut self, _sql: &str) -> Result<()>
fn check(&mut self, _sql: &str) -> Result<()>
Verify without executing. Only called when the plugin advertises check.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".