vlcn-orm
vlcn-orm copied to clipboard
Implement take/before/after/orderBy hoisting
in SQLExpression.ts
This is done for orderBy
(but possibly not at each hop?).
take
presents problems if the query traverses many edges. We can disallow takes
between hops... SQL technically disallows this unless you convert the query to using sub-selects but this is not ideal from a performance perspective.
take
inside a hop is also a highly unusual use case.
before
and after
will be significant amounts of work. They're technically just orderBy
operations but the key difference is we should be able to return a cursor that represents the next "page" after applying before/after.
Lets implement before
and after
as we do orderBy
and leave cursoring to a separate task.