(pipe: Vec<Transform>, ctx: &mut Context)
| 94 | } |
| 95 | |
| 96 | pub(in crate::sql) fn wrap(pipe: Vec<Transform>, ctx: &mut Context) -> Result<Vec<SqlTransform>> { |
| 97 | // We map From and Join into SqlTransforms, because we need to change their RIIds. |
| 98 | // Others we just wrap into SqlTransform::Super. |
| 99 | |
| 100 | pipe.into_iter() |
| 101 | .map(|x| { |
| 102 | Ok(match x { |
| 103 | Transform::From(table_ref) => { |
| 104 | let riid = ctx |
| 105 | .anchor |
| 106 | .create_relation_instance(table_ref, HashMap::new()); |
| 107 | SqlTransform::From(riid) |
| 108 | } |
| 109 | Transform::Join { with, side, filter } => { |
| 110 | let with = ctx.anchor.create_relation_instance(with, HashMap::new()); |
| 111 | SqlTransform::Join { with, side, filter } |
| 112 | } |
| 113 | x => SqlTransform::Super(x), |
| 114 | }) |
| 115 | }) |
| 116 | .try_collect() |
| 117 | } |
| 118 | |
| 119 | fn vecs_contain_same_elements<T: Eq + std::hash::Hash>(a: &[T], b: &[T]) -> bool { |
| 120 | let a: HashSet<&T, RandomState> = a.iter().collect(); |
no test coverage detected