Skip to main content

VirtualTableCursor

Trait VirtualTableCursor 

Source
pub trait VirtualTableCursor: Send {
    // Required methods
    fn filter(
        &mut self,
        cx: &Cx,
        idx_num: i32,
        idx_str: Option<&str>,
        args: &[SqliteValue],
    ) -> Result<()>;
    fn next(&mut self, cx: &Cx) -> Result<()>;
    fn eof(&self) -> bool;
    fn column(&self, ctx: &mut ColumnContext, col: i32) -> Result<()>;
    fn rowid(&self) -> Result<i64>;
}
Expand description

A cursor for scanning a virtual table.

Cursors are Send but NOT Sync — they are single-threaded scan objects bound to a specific filter invocation.

§Lifecycle

  1. filter begins a scan with planner-chosen parameters.
  2. Iterate: check eof, read column/rowid, advance with next.
  3. The cursor is dropped when the scan is complete.

Required Methods§

Source

fn filter( &mut self, cx: &Cx, idx_num: i32, idx_str: Option<&str>, args: &[SqliteValue], ) -> Result<()>

Begin a scan with the filter parameters chosen by best_index.

Source

fn next(&mut self, cx: &Cx) -> Result<()>

Advance to the next row.

Source

fn eof(&self) -> bool

Whether the cursor has moved past the last row.

Source

fn column(&self, ctx: &mut ColumnContext, col: i32) -> Result<()>

Write the value of column col into ctx.

Source

fn rowid(&self) -> Result<i64>

Return the rowid of the current row.

Implementors§