Context
During the review of PR #1637, a suggestion was made to refactor the DbContext dataclass (introduced in that PR) into an abstract class that can be extended by database-specific implementations.
Current State
Currently, DbContext is a simple dataclass that holds a database connection and cursor:
- Located in:
components/job-orchestration/job_orchestration/scheduler/compress/compression_scheduler.py
- Holds generic
connection and cursor attributes
Proposed Improvement
Make DbContext an abstract class that:
- Defines a common interface for database operations
- Allows each database connection type to extend with its own implementation
- Potentially includes additional database-specific attributes and methods
References
Additional Context
This refactoring should also consider consolidating all related database connection + cursor combinations throughout the codebase to use the new context class structure.
Context
During the review of PR #1637, a suggestion was made to refactor the
DbContextdataclass (introduced in that PR) into an abstract class that can be extended by database-specific implementations.Current State
Currently,
DbContextis a simple dataclass that holds a database connection and cursor:components/job-orchestration/job_orchestration/scheduler/compress/compression_scheduler.pyconnectionandcursorattributesProposed Improvement
Make
DbContextan abstract class that:References
Additional Context
This refactoring should also consider consolidating all related database connection + cursor combinations throughout the codebase to use the new context class structure.