Skip to content

Init work on postgresql implementation to the dashboard to get cases inside PGSQL #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

aluneau
Copy link
Contributor

@aluneau aluneau commented Mar 27, 2025

PR Description

I did initiate work on postgresql database implementation.
The goal would be to get cases on the postgresql database as well as on Redis for a start, then add further things on the postgresql
I want to use Alchemy as ORM
What is added:

  • db.py: contains configuration of the postgresql database
  • models.py: contains the models I did start to create the case model it contains only caseNumber for now I will add more columns. Also I did test JSONB column it seems to be something we should use for some fields
  • dependencies.py dependencies injection
  • docker-compose modification to run a local environment, OCP postgresql will be needed for production

What's left to do

  • ✅ init the database connection + main files
  • ✅ create table migration if database is empty
  • ✅ modify docker-compose
  • ✅ create a first table including some columns
  • ✅ test JSONB column type
  • ❌ finish case table, include more columns
  • ❌ add all cases that are caught inside get_cases function into the postgresql database
  • ❌ OCP implementation: adding postgresql database YAML files (deployment/service...) / Use a postgresql instance already present
  • ❌ env variables for postgresql connection
  • ...

aluneau and others added 27 commits March 27, 2025 21:50
implements sqlalchemy 2.0 style ORM mapping
fixes black and ruff linter issues

fixes black linter issues

fixes ruff and flake8 linter issues

fixes black linter issue

fixes isort linter issues
@PB1899 PB1899 force-pushed the postgres-implementation branch from ef2ebf2 to 36f64e4 Compare July 23, 2025 07:53
PB1899 and others added 22 commits July 25, 2025 06:00
generated by Cursor AI
- raises early exception if the Postgres env variables are missing
- sets up test DB session with SQLite indpeendent of the Postgres config
Eliminated fixture duplication by removing duplicate fake_data and
test_db_session fixtures from test_database.py, now using centralized
versions from conftest.py. Created factory methods to eliminate repetitive
test setup and broke down oversized test methods into focused,
single-responsibility tests.
Centralized inconsistent data handling by creating helper functions that
replaced scattered product_version extraction logic across 4 test methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants