Translixir.Model.Query (translixir v0.4.0) View Source
Query module is responsible for facilitationg the creation of a query to send to endpoint /query
:
query =
Query.find(%{}, [:h, :q])
|> Query.where(["?p1 :name ?n", "?p1 :is-sql ?s"])
|> Query.order_by(["?s true"])
|> Query.limit(5)
|> Query.offset(20)
|> Query.with_full_results()
|> Query.build()
expected =
"{:query {:find [?h ?q], :full-results? true, :limit 5, :offset 20, :order-by [[?s true]], :where [[?p1 :name ?n] [?p1 :is-sql ?s]]}}"
assert query == expected