Skip to main content

codegen_select

Function codegen_select 

Source
pub fn codegen_select(
    b: &mut ProgramBuilder,
    stmt: &SelectStatement,
    schema: &[TableSchema],
    _ctx: &CodegenContext,
) -> Result<(), CodegenError>
Expand description

Generate VDBE bytecode for a SELECT statement.

Handles three patterns:

  1. Expression-only: SELECT 1+1, SELECT abs(-5) (no FROM)
  2. Rowid lookup: SELECT cols FROM t WHERE rowid = ?
  3. Full table scan: SELECT cols FROM t

Returns the cursor number used (for composability).