View Source Fob.PageBreak (Fob v1.0.0)
A data structure for describing where in a dataset we have drawn a page line
Link to this section Summary
Functions
Expands the n-dimensional space occupied by a bound of page-breaks
Link to this section Types
Link to this section Functions
@spec expand_space(start :: [t()], stop :: [t()], proposed :: [t()], Ecto.Query.t()) :: {new_start :: [t()], new_stop :: [t()]}
Expands the n-dimensional space occupied by a bound of page-breaks
If one holds on to the page-breaks from the start
and stop
of a dataset
(with start
being the first record returned and stop
being the last
record of the most recently requested page; i.e. the cursor), they have
the boundaries of the page-break-space for the query
. It can be useful to
be able to expand this space in the case of row insertions into the database.
If an insertion comes in, one must compute its page-break values and compare
those to the held start
and stop
page-break values.
This function performs that comparison and returns a tuple of the new
start
and stop
, where proposed
could possibly replace the start
or
stop
(or neither).