Skip to content

Task 4: Migrate Python DB layer to Postgres/Supabase #35

@William-Hill

Description

@William-Hill

Description

Replace pymysql/MariaDB with psycopg2/Postgres in the Python operations layer.

Files to Modify

  • operations/db_config.py — Replace MariaDB config with Supabase Postgres config (env var driven)
  • operations/db_utils.py — Replace pymysql with psycopg2, update connection logic, SQL syntax
  • operations/__init__.py — Update references
  • requirements.txt — Add psycopg2-binary

Key Changes

  • pymysql.connect()psycopg2.connect() with RealDictCursor
  • mysql+pymysql://postgresql+psycopg2:// for SQLAlchemy
  • SHOW TABLESSELECT table_name FROM information_schema.tables WHERE table_schema='public'
  • Test connection with python -m operations.test_db_connection

Plan Reference

See docs/plans/2026-02-14-bishop-state-rebranding-plan.md — Task 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend services, APIsrebranding: bishop-stateKCTCS to Bishop State Community College rebranding work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions