David Stotijn
10/20/2022, 6:13 PMselect * from "foobar"
where ("foo", "bar", "baz") > ('lorem', 'ipsum', 'dolor')
Ran Rosenmann
10/20/2022, 6:27 PMDavid Stotijn
10/20/2022, 6:31 PMid
and createdAt
I’m comparing against are previously fetched):
select
id, "createdAt"
from
"EventParticipant"
where
"eventId" = 'b891c975-439a-4c64-ae73-48d2af411909'
and
("createdAt", id) > ('2022-10-20 12:03:08.035', 'f4b41ba3-0be9-4a84-9acd-64810cddbe34')
order by
"createdAt" asc,
id asc
limit 100;
Ideally, I want to use @prisma/client
and findMany
, especially because the columns I’ll be sorting on will be dynamic/based on user input.Ran Rosenmann
10/20/2022, 6:31 PMRan Rosenmann
10/20/2022, 6:38 PMRan Rosenmann
10/20/2022, 6:39 PMDavid Stotijn
10/20/2022, 6:44 PMfindMany
. One step back, the reason why I have a need for “tuple comparisons” is because it’s the only way I’ve found to do cursor based pagination where I need to sort on one ore more non sequential columns.David Stotijn
10/20/2022, 6:45 PMcursor
property that findMany
supports, but you can only use it for “unique” columns.Ran Rosenmann
10/20/2022, 6:55 PMDavid Stotijn
10/20/2022, 6:59 PM