Skip to content

feat(indexer): removed RelationshipTypeMapper

What does this MR do and why?

Duo Summary

This code change simplifies how the system handles relationship types in a code analysis tool. Previously, the system used a complex mapping system that converted relationship types (like "calls", "contains", etc.) into numeric IDs for storage efficiency. The new approach removes this mapping layer and stores relationship types directly as strings instead of numbers.

The main benefits are:

  • Simpler code: Eliminates the RelationshipTypeMapping class and all its associated complexity
  • Easier debugging: Relationship types are now human-readable strings in the database instead of cryptic numbers
  • Reduced maintenance: No need to maintain bidirectional mappings between strings and IDs

The changes touch multiple parts of the system including database operations, query building, and test files. All the conversion logic that translated between relationship type names and numeric IDs has been removed. Instead of calling mapping.get_type_id(RelationshipType::Calls) to get a number, the code now simply calls RelationshipType::Calls.as_string() to get the string directly.

This is a refactoring that trades a small amount of storage efficiency for significantly improved code maintainability and readability.

Related Issues

#232

Testing

All existing tests pass, but frontend bindings + MCP might need to be verified for a change in behavior that E2E tests don't cover.

Performance Analysis

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.
Edited by Michael Usachenko

Merge request reports

Loading