Skip to content

OPS-REF-002D: split PostgreSQL execution helpers#653

Merged
ktalpay merged 1 commit into
developfrom
codex/extract-postgresql-execution-helpers
Jun 2, 2026
Merged

OPS-REF-002D: split PostgreSQL execution helpers#653
ktalpay merged 1 commit into
developfrom
codex/extract-postgresql-execution-helpers

Conversation

@ktalpay

@ktalpay ktalpay commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Consolidate low-level database execution, fetch and transaction calls into a single reusable module to reduce duplication while preserving existing repository orchestration and behavior.

Description

  • Added src/carbonfactor_parser/persistence/postgresql_execution.py with execute, fetchone, commit, and rollback that retain the original getattr-based calling semantics and parameter handling.
  • Updated src/carbonfactor_parser/persistence/postgresql_source_family_repository.py to import and use the new helpers in place of the internal _execute/_fetchone/_commit/_rollback functions and removed those internal helpers.
  • Added focused tests in tests/test_postgresql_execution.py that verify execute calls with and without parameters, fetchone calls, and commit/rollback behavior when the methods are present or absent.

Testing

  • Ran python -m pytest tests/test_postgresql_source_family_repository.py which completed with 21 passed, 1 skipped.
  • Ran the full test-suite with python -m pytest which completed with 2169 passed, 8 skipped.
  • Ran lint checks with python -m ruff check on the modified files and the checks passed.

Codex Task

@ktalpay
ktalpay merged commit ea993a8 into develop Jun 2, 2026
2 checks passed
@ktalpay
ktalpay deleted the codex/extract-postgresql-execution-helpers branch June 2, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant