Design and Implement a Structured Content Query Library
Let services describe catalog queries through a safe object model that compiles to parameterized database queries.
A streaming application shows rows such as Trending Dramas, New This Week, and Top Rated Thrillers. Today each backend service hand-writes similar catalog queries with inconsistent behavior.
Design and implement the core of a shared library through which a caller describes filters, ordering, and a limit, and the library compiles that description into a parameterized query.
For this exercise, assume a reviewed field registry defines data type and allowed operators, query objects are immutable, values never become SQL text, limits are bounded, and one compiler dialect is required initially. Keep execution, connection pooling, caching, and the content catalog schema outside scope.