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 TABLES → SELECT 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
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— Replacepymysqlwithpsycopg2, update connection logic, SQL syntaxoperations/__init__.py— Update referencesrequirements.txt— Addpsycopg2-binaryKey Changes
pymysql.connect()→psycopg2.connect()withRealDictCursormysql+pymysql://→postgresql+psycopg2://for SQLAlchemySHOW TABLES→SELECT table_name FROM information_schema.tables WHERE table_schema='public'python -m operations.test_db_connectionPlan Reference
See
docs/plans/2026-02-14-bishop-state-rebranding-plan.md— Task 4