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

Link to this section Types

@type t() :: %Fob.PageBreak{
  column: term(),
  direction: term(),
  table: term(),
  value: term()
}

Link to this section Functions

Link to this function

add_query_info(page_breaks, query)

View Source
Link to this function

add_query_info(page_break, ordering_config, query)

View Source
Link to this function

compare(a, b, query)

View Source (since 0.2.0)
Link to this function

expand_space(start, stop, proposed, query)

View Source (since 0.3.0)
@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).

Link to this function

wrap_to_routeable(page_breaks, query)

View Source