fix: eliminate N+1 queries in batch POST endpoints (#25) #52

Merged
cal merged 2 commits from ai/major-domo-database-25 into next-release 2026-03-10 14:37:57 +00:00

2 Commits

Author SHA1 Message Date
Cal Corum
17f67ff358 fix: address review feedback (#52)
Guard bulk ID queries against empty lists to prevent PostgreSQL
syntax error (WHERE id IN ()) when batch POST endpoints receive
empty request bodies.

Affected endpoints:
- POST /api/v3/transactions
- POST /api/v3/results
- POST /api/v3/schedules
- POST /api/v3/battingstats

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 01:51:58 -06:00
Cal Corum
580b22ec6f fix: eliminate N+1 queries in batch POST endpoints (#25)
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m8s
Replace per-row Team/Player lookups with bulk IN-list queries before
the validation loop in post_transactions, post_results, post_schedules,
and post_batstats. A 50-move batch now uses 2 queries instead of 150.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 17:33:32 -06:00