diff --git a/core/translate/select.rs b/core/translate/select.rs index 54570c74d..301b4beef 100644 --- a/core/translate/select.rs +++ b/core/translate/select.rs @@ -19,6 +19,26 @@ use crate::{function::Func, schema::Table, vdbe::BranchOffset}; use super::SortInfo; +pub struct Select<'a> { + pub columns: &'a Vec, + pub column_info: Vec>, + pub src_tables: Vec>, // Tables we use to get data from. This includes "from" and "joins" + pub limit: &'a Option, + pub order_by: &'a Option>, + pub exist_aggregation: bool, + pub where_clause: &'a Option, + /// Ordered list of opened read table loops + /// Used for generating a loop that looks like this: + /// cursor 0 = open table 0 + /// for each row in cursor 0 + /// cursor 1 = open table 1 + /// for each row in cursor 1 + /// ... + /// end cursor 1 + /// end cursor 0 + pub loops: Vec, +} + #[derive(Debug)] pub struct SrcTable<'a> { pub table: Table, @@ -91,26 +111,6 @@ pub struct LoopInfo { pub open_cursor: usize, } -pub struct Select<'a> { - pub columns: &'a Vec, - pub column_info: Vec>, - pub src_tables: Vec>, // Tables we use to get data from. This includes "from" and "joins" - pub limit: &'a Option, - pub order_by: &'a Option>, - pub exist_aggregation: bool, - pub where_clause: &'a Option, - /// Ordered list of opened read table loops - /// Used for generating a loop that looks like this: - /// cursor 0 = open table 0 - /// for each row in cursor 0 - /// cursor 1 = open table 1 - /// for each row in cursor 1 - /// ... - /// end cursor 1 - /// end cursor 0 - pub loops: Vec, -} - pub fn build_select<'a>(schema: &Schema, select: &'a ast::Select) -> Result> { match &select.body.select { ast::OneSelect::Select {