crud
crud copied to clipboard
Pagination info on select/pairs
crud has 2 methods: select and pairs which returns a list of tuples, also it has after option that used for pagination. Thats great but in different interfaces: rest/graphql/language connectors with reactive resotories it wiil be great to have smth like pageInfo in GraphQL:
pageInfo { startCursor - first tuple in the returned list endCursor - last tuple in the returned list hasNextPage - boolean, true if any tuples exists after last tuple in the list hasPreviousPage - boolean, true if any tuples exists before first tuple in the list }
Since this info is optional and needed only in pagination it will be returned only if opts.pageinfo option if true (false by default)
Suggested API: res = { rows = {...}, metadata={...}, pageinfo={ startCursor = ..., endCursor = ..., hasNextPage = ..., hasPreviousPage = ...}, }