Data Layer medium complexity backend
0
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Encapsulates the SQL construction logic for the activity feed endpoint. Builds parameterized PostgreSQL queries with cursor-based pagination, multi-table joins, and dynamic filter composition. Separates query logic from the API route handler to keep the service layer clean and testable.

Feature: Activity Feed

activity-feed-query-builder

Responsibilities

  • Build cursor-based paginated SELECT with JOIN on users, contacts, activity_approvals
  • Compose parameterized WHERE clauses from filter inputs
  • Generate next/previous cursor values from result rows
  • Prevent SQL injection via parameterized query construction

Interfaces

buildFeedQuery(filters: FeedFilters, scope: DataScope, cursor?: string, limit?: number): ParameterizedQuery
extractNextCursor(rows: Row[]): string | null
buildFilterClauses(filters): WhereFragment[]
buildJoins(): JoinFragment[]

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component