Track the source entity for a variable This enables identity-based comparison in set operations
(&mut self, var_name: &str, value: &Value)
| 253 | /// Track the source entity for a variable |
| 254 | /// This enables identity-based comparison in set operations |
| 255 | pub fn with_entity(&mut self, var_name: &str, value: &Value) { |
| 256 | match value { |
| 257 | Value::Node(node) => { |
| 258 | self.source_entities |
| 259 | .insert(var_name.to_string(), EntityId::Node(node.id.clone())); |
| 260 | } |
| 261 | Value::Edge(edge) => { |
| 262 | self.source_entities |
| 263 | .insert(var_name.to_string(), EntityId::Edge(edge.id.clone())); |
| 264 | } |
| 265 | _ => { |
| 266 | // Properties and computed values don't have entity IDs |
| 267 | // We might track their source entity in the future |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /// Get the primary entity ID for this row (if any) |
| 273 | /// Used for simple identity comparisons |
no test coverage detected