mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
feat(api): add paginated events feed JSON endpoint (#25)
GET /events.json with cursor-based pagination and filtering: - Filter by adapter, category, since/until, region bbox - Cursor pagination via (time DESC, id DESC) ordering - Returns events with GeoJSON geometry parsed as objects - Validation returns 400 with clear error messages Migration 014 adds composite index for efficient pagination. Tests: 17 new tests covering filters, pagination, validation. Co-authored-by: Matt Johnson <mj@k7zvx.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
494ad1c799
commit
246cd75051
3 changed files with 771 additions and 0 deletions
5
sql/migrations/014_events_time_id_index.sql
Normal file
5
sql/migrations/014_events_time_id_index.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- Migration 014: Add composite index for cursor-based pagination
|
||||
-- Supports ORDER BY (time DESC, id DESC) with efficient range queries
|
||||
|
||||
CREATE INDEX IF NOT EXISTS events_time_id_desc_idx
|
||||
ON public.events (time DESC, id DESC);
|
||||
Loading…
Add table
Add a link
Reference in a new issue