phoenix_datatables v0.2.1 PhoenixDatatables.Query

Functions for updating an Ecto.Query based on Datatables request parameters.

Link to this section Summary

Functions

Add offset and limit clauses to the provided queryable based on the “length” and “start” parameters passed in the Datatables request

Add AND where clause to the provided queryable based on the “search” parameter passed in the Datatables request. For some queries, :columns need to be passed - see documentation for PhoenixDatatables.execute for details

Add order_by clauses to the provided queryable based on the “order” params provided in the Datatables request. For some queries, :columns need to be passed - see documentation for PhoenixDatatables.execute for details

Calculate the number of records that will retrieved with the provided queryable

Link to this section Functions

Link to this function paginate(queryable, params)

Add offset and limit clauses to the provided queryable based on the “length” and “start” parameters passed in the Datatables request.

Link to this function search(queryable, params, options \\ [])

Add AND where clause to the provided queryable based on the “search” parameter passed in the Datatables request. For some queries, :columns need to be passed - see documentation for PhoenixDatatables.execute for details.

Link to this function sort(queryable, params, sortable \\ nil)

Add order_by clauses to the provided queryable based on the “order” params provided in the Datatables request. For some queries, :columns need to be passed - see documentation for PhoenixDatatables.execute for details.

Link to this function total_entries(queryable, repo)

Calculate the number of records that will retrieved with the provided queryable.