Data pagination

is there away i can use Scrivener with Ecto.Adapters.SQL.query!(__MODULE__, sql, params)

Scrivener uses Ecto’s query DSL to add the pagination to the query, so no, it is not possible to use it with raw SQL strings.

what are the alternative If you have a complex sql

You would have to do the pagination manually by adding a limit and offset to your query or by using a database cursor.

This is exactly what I did ORDER BY r.inserted_at Limit $2 OFFSET $3