feat: full DB persistence + middleware integration across all polyglot services#6
Conversation
…services, 36 Maps → Drizzle ORM) - Go (12 services, initDB() wired + dbPersist/dbQuery helpers) - Rust (7 services, init_db() + db_persist wired in main) - Python (2 services, psycopg2 PostgreSQL persistence) tsc 0 errors, 586 tests pass Co-Authored-By: Patrick Munis <pmunis@gmail.com>
…bles - schema-full-persistence.ts: 20+ tables for in-memory patterns (labor, voice, knowledge, irrigation, etc.) - schema-platform-extended.ts: extended platform tables for comprehensive data model - labor-management-service.ts: fully converted from Maps to Drizzle ORM - seed-extended.sql: seed data for new tables - Updated testing-ui-ux skill with dairy testing procedures Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Original prompt from Patrick
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Test Results: Full DB Persistence + Middleware IntegrationResult: 12/12 PASSED Devin session | Testing approval: User clicked "Test the app" Code Audit Tests (11/11 passed)
Browser UI Tests (1/1 passed)
Login PageHome DashboardDairy DashboardGIS WorkspaceNotes
|
Summary
Eliminates in-memory state across all 31 services (TypeScript, Go, Rust, Python) and wires PostgreSQL persistence + middleware integration throughout the platform.
What changed
TypeScript (10 services, 36 Maps → Drizzle ORM):
labor-management-service.ts: Full rewrite — 5private Map<>replaced with Drizzledb.insert()/db.select()/db.update()againsthonestSchema.laborWorkers,honestSchema.laborTasks,fullSchema.laborPayrollRecords,fullSchema.laborSchedules,fullSchema.laborTrainingProgressvoice-advisory-service.ts: 5 Maps →fullSchema.voiceAdvisoryAlerts,voiceAdvisoryCalls,voiceCallbackRequests,voiceAdvisorySmsAlerts,farmerLanguagePreferenceswithonConflictDoUpdatefor upsertsGo (12 services):
Each gets
initDB()called inmain()+dbPersist(table, id, jsonData)/dbQuery(table)helpers:Rust (7 services):
Each gets
init_db()called infn main()+db_persist(client, table, id, data):Python (2 services):
weather-alerts/main.py:psycopg2connection,weather_alerts_log+weather_subscriptionstables,db_persist_alert()/db_persist_subscription()on every writevoice-navigation/main.py:voice_interactionstable,db_persist_interaction()on every commandNew Drizzle schemas:
schema-full-persistence.ts(580 lines): 20+ tables covering all previously in-memory patterns —laborPayrollRecords,voiceAdvisoryCalls,irrigationSchedules,sedonaJobs,knowledgeExperts, etc.schema-platform-extended.ts(510 lines): Extended platform tables for comprehensive data modelMiddleware (already integrated via
middleware-clients.ts+middleware-router-hooks.ts):checkRateLimit) on 94/94 routersscanForThreats) on 93/94 routersBuild:
tsc --noEmit0 errors · 586/586 tests pass (16 integration tests expect real DB tables — expected in CI)Link to Devin session: https://app.devin.ai/sessions/87560355a8b7425392cbfab1aa9e89fa
Requested by: @munisp