Skip to content

Commit

Permalink
feat(cognitarium): handle engine limit query node
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Jun 5, 2023
1 parent ee8254b commit 9fa3b9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/okp4-cognitarium/src/querier/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ impl<'a> QueryEngine<'a> {
}
QueryNode::ForLoopJoin { left, right } => Box::new(move |_| Box::new(iter::empty())),
QueryNode::Skip { child, first } => Box::new(move |_| Box::new(iter::empty())),
QueryNode::Limit { child, first } => Box::new(move |_| Box::new(iter::empty())),
QueryNode::Limit { child, first } => {
let upstream = self.eval_node(child);
Box::new(move |vars| -> ResolvedVariablesIterator {
Box::new(upstream(vars).take(first))
})
}
}
}
}
Expand Down

0 comments on commit 9fa3b9d

Please sign in to comment.