userver
userver copied to clipboard
Allow specifying ORDER BY in PostgreSQL cache policies
trafficstars
See https://userver.tech/d9/dde/pg_cache.html#pg_cc_cache_policy
We need a way to say
// `Order by` clause of the query.
//
// Required: no
static constexpr const char* kOrderBy = "id DESC, updated ASC";
The ORDER BY functionality is useful when we have a table that stores all the events with some updated timestamp, but in cache we wish to store only the last event. To do that we need a guarantee on order of insert_or_assign calls
Tests also required
Internal ticket: 3248