+ def fetch_paginated(query, params, :offset, table_binding) do
+ options = cast_params(params)
+
+ query
+ |> paginate(options, :offset, table_binding)
+ |> Repo.all()
+ end
+
+ @spec paginate(Ecto.Query.t(), map(), type(), atom() | nil) :: [Ecto.Schema.t()]
+ def paginate(query, options, method \\ :keyset, table_binding \\ nil)