pub trait DataSource {
// Required methods
fn get_table_rows(&self, table: &str) -> ExecutionResult<Vec<Rc<Row>>>;
fn get_index_range_with_limit(
&self,
table: &str,
index: &str,
range_start: Option<&Value>,
range_end: Option<&Value>,
include_start: bool,
include_end: bool,
limit: Option<usize>,
offset: usize,
reverse: bool,
) -> ExecutionResult<Vec<Rc<Row>>>;
fn get_index_point(
&self,
table: &str,
index: &str,
key: &Value,
) -> ExecutionResult<Vec<Rc<Row>>>;
fn get_column_count(&self, table: &str) -> ExecutionResult<usize>;
// Provided methods
fn get_index_range(
&self,
table: &str,
index: &str,
range_start: Option<&Value>,
range_end: Option<&Value>,
include_start: bool,
include_end: bool,
) -> ExecutionResult<Vec<Rc<Row>>> { ... }
fn get_index_point_with_limit(
&self,
table: &str,
index: &str,
key: &Value,
limit: Option<usize>,
) -> ExecutionResult<Vec<Rc<Row>>> { ... }
fn get_gin_index_rows(
&self,
table: &str,
index: &str,
key: &str,
value: &str,
) -> ExecutionResult<Vec<Rc<Row>>> { ... }
fn get_gin_index_rows_by_key(
&self,
table: &str,
index: &str,
key: &str,
) -> ExecutionResult<Vec<Rc<Row>>> { ... }
fn get_gin_index_rows_multi(
&self,
table: &str,
index: &str,
pairs: &[(&str, &str)],
) -> ExecutionResult<Vec<Rc<Row>>> { ... }
}Expand description
Data source trait for providing table and index data.
Implementations of this trait provide access to table rows and index lookups for the physical plan runner.
Required Methods§
Sourcefn get_table_rows(&self, table: &str) -> ExecutionResult<Vec<Rc<Row>>>
fn get_table_rows(&self, table: &str) -> ExecutionResult<Vec<Rc<Row>>>
Returns all rows from a table.
Sourcefn get_index_range_with_limit(
&self,
table: &str,
index: &str,
range_start: Option<&Value>,
range_end: Option<&Value>,
include_start: bool,
include_end: bool,
limit: Option<usize>,
offset: usize,
reverse: bool,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_index_range_with_limit( &self, table: &str, index: &str, range_start: Option<&Value>, range_end: Option<&Value>, include_start: bool, include_end: bool, limit: Option<usize>, offset: usize, reverse: bool, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from an index scan with a key range, limit, offset, and reverse option. This enables true pushdown of LIMIT to the storage layer.
Sourcefn get_index_point(
&self,
table: &str,
index: &str,
key: &Value,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_index_point( &self, table: &str, index: &str, key: &Value, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from an index point lookup.
Sourcefn get_column_count(&self, table: &str) -> ExecutionResult<usize>
fn get_column_count(&self, table: &str) -> ExecutionResult<usize>
Returns the column count for a table.
Provided Methods§
Sourcefn get_index_range(
&self,
table: &str,
index: &str,
range_start: Option<&Value>,
range_end: Option<&Value>,
include_start: bool,
include_end: bool,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_index_range( &self, table: &str, index: &str, range_start: Option<&Value>, range_end: Option<&Value>, include_start: bool, include_end: bool, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from an index scan with a key range.
Sourcefn get_index_point_with_limit(
&self,
table: &str,
index: &str,
key: &Value,
limit: Option<usize>,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_index_point_with_limit( &self, table: &str, index: &str, key: &Value, limit: Option<usize>, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from an index point lookup with limit.
Sourcefn get_gin_index_rows(
&self,
table: &str,
index: &str,
key: &str,
value: &str,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_gin_index_rows( &self, table: &str, index: &str, key: &str, value: &str, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from a GIN index lookup by key-value pair.
Used for JSONB path equality queries like $.category = 'Electronics'.
Sourcefn get_gin_index_rows_by_key(
&self,
table: &str,
index: &str,
key: &str,
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_gin_index_rows_by_key( &self, table: &str, index: &str, key: &str, ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from a GIN index lookup by key existence. Used for JSONB key existence queries.
Sourcefn get_gin_index_rows_multi(
&self,
table: &str,
index: &str,
pairs: &[(&str, &str)],
) -> ExecutionResult<Vec<Rc<Row>>>
fn get_gin_index_rows_multi( &self, table: &str, index: &str, pairs: &[(&str, &str)], ) -> ExecutionResult<Vec<Rc<Row>>>
Returns rows from a GIN index lookup by multiple key-value pairs (AND query).
Used for combined JSONB path equality queries like $.category = 'A' AND $.status = 'active'.