strapi / rfcs

RFCs for Strapi future changes
68 stars 33 forks source link

[V4] Query engine #31

Closed alexandrebodin closed 2 years ago

alexandrebodin commented 3 years ago

Query Engine

This PR introduces a draft version of the Query Engine.

You can read it here

brettwillis commented 3 years ago

I like that population can be controlled for components etc, where currently only population of the top level model can be controlled.

Here are some initial comments:

  1. I can see some filtering operators that not all database layers will support (e.g. $endsWith, $contains, and also complex combinations of and/or). Have you considered if there shall be some defined behaviour when a database connector doesn't support a query? Just throw an error?
  2. Some database layers support pagination/continuation via continuation tokens. Tokens could be any type but typically a string. Have you considered supporting continuation tokens from previous queries, as an alternative to offset?

Some motivation behind point 2: I'm thinking of some database layers where use of limit can be costly, costing a "read operation" for every skipped entity. Pagination in the admin dashboard could be more effective with continuation tokens.