Skip to content

Refactor DbContext to be an abstract class with database-specific implementations #1674

@coderabbitai

Description

@coderabbitai

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions