4242 * @offset: a position (u64) that determines the number of element (in SQL row)
4343 * returned by request.
4444 * @limit: a position (u64) that give the number of element in [0,..,offset - 1] to skip skip.
45+ * @reverse: a boolean that reverse the order of the result.
4546 */
4647struct jsonrpc_paginator {
4748 /** reall usefult for access to gossip map */
@@ -50,6 +51,7 @@ struct jsonrpc_paginator {
5051 * query please use the sql plugins */
5152 const u64 * offset ;
5253 const u64 * limit ;
54+ const bool * reverse ;
5355 /* FIXME: more smarter one? like sort_by = "json key"
5456 * but this required to have a mapping between json_keys and sql keys
5557 * maybe we had already somethings in the sql plugin? */
@@ -62,15 +64,17 @@ struct jsonrpc_paginator {
6264 *
6365 * BTW: I love C Macros, really!
6466 */
65- static inline struct jsonrpc_paginator * new_paginator (const tal_t * ctx , const char * * batch ,
66- const u64 * limit , const u64 * offset )
67+ static inline struct jsonrpc_paginator *
68+ new_paginator (const tal_t * ctx , const char * * batch , const u64 * limit ,
69+ const u64 * offset , const bool * reverse )
6770{
6871 struct jsonrpc_paginator * paginator = NULL ;
6972 if (batch || (limit && offset )) {
7073 paginator = tal (ctx , struct jsonrpc_paginator );
7174 paginator -> batch = batch ;
7275 paginator -> limit = limit ;
7376 paginator -> offset = offset ;
77+ paginator -> reverse = reverse ;
7478 return paginator ;
7579 }
7680 return NULL ;
0 commit comments