GH-475: [ATTRIBUTES] TabularAttributeResolver opens a new postgres connection for each call#476
Conversation
…use dependency injection for PostgresRepository
…ived server-injected repositories for improved performance.
…nd Mongo repositories
…ection for Postgres, Neo4j, and Mongo repositories; update related tests accordingly.
…o recommend using long-lived server-injected repositories for improved performance.
There was a problem hiding this comment.
Code Review
This pull request refactors the EntityAttributeProcessor and GraphMetadataManager to utilize dependency injection for database repositories, moving away from on-demand repository retrieval via utility functions. By injecting PostgresRepo, Neo4jRepo, and MongoRepo through a new ProcessorDependencies struct, the system now favors long-lived connections and improves overall testability. The server's entity lifecycle methods and associated test suites have been updated to support these architectural changes. I have no feedback to provide as no issues were identified in the implementation.
…tion failure; update service methods and tests to handle errors appropriately.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements dependency injection for database repositories within the EntityAttributeProcessor and GraphMetadataManager, replacing the previous pattern of fetching repositories per-request. This change promotes the use of long-lived connections and improves testability across the core API. A review comment suggests optimizing the CreateResolve method by moving the redundant InitializeTables call to the initialization phase to reduce unnecessary database roundtrips.
This pr closes #475