FatEcto.FatPaginator behaviour (FatEcto v1.1.0)

View Source

Provides pagination functionality for Ecto queries.

This module can be used to paginate query results by specifying limit and skip parameters. It also supports counting the total number of records for pagination metadata.

Usage

defmodule Fat.MyContext do
  use FatEcto.FatPaginator, repo: Fat.Repo, default_limit: 10, max_limit: 100

  # Custom functions can be added here
end

Now you can use the paginate/2, paginator/3, and paginate_get_records/3 functions within Fat.MyContext.

Summary

Functions

Callback function that runs after the module is compiled.

Callbacks

aggregate(t)

@callback aggregate(Ecto.Query.t()) :: Ecto.Query.t()

count_query(t)

@callback count_query(Ecto.Query.t()) :: Ecto.Query.t()

data_query(t, integer, integer)

@callback data_query(Ecto.Query.t(), integer(), integer()) :: Ecto.Query.t()

Functions

__after_compile__(map, bytecode)

@spec __after_compile__(%{module: atom()}, any()) :: nil

Callback function that runs after the module is compiled.