Selecto (Selecto v0.1.0)
Documentation for Selecto,
a query writer and report generator for Elixir/Ecto
TODO
having
json/embeds/arrays/maps?
json: tablen[field].somejsonkey tablen[field][index].somekey...
distinct
select into tuple or list instead of map more efficient? ability to add synthetic root, joins, filters, columns
union, union all, intersect, intersect all -- pass in lists of alternative filters -- allow multiple unions
limit, offset
subqueries
Mebbie: windows? CTEs? recursive? first, last?? as limit, reverse_order
ERROR CHECKS -- Has association by right name?
Link to this section Summary
Functions
Generate a selecto structure from this Repo following the instructinos in Domain map
Generate and run the query, returning list of maps (for now...)
add a filter to selecto. Send in a tuple with field name and filter value
Returns an Ecto.Query with all your filters and selections added..eventually!
Add to the Group By
Add to the Order By
add a field to the Select list. Send in one or a list of field names or selectable tuples TODO allow to send single, and special forms..
Link to this section Functions
available_columns(selecto)
available_filters(selecto)
configure(repo, domain)
Generate a selecto structure from this Repo following the instructinos in Domain map
execute(selecto, opts \\ [])
Generate and run the query, returning list of maps (for now...)
filter(selecto, filters)
add a filter to selecto. Send in a tuple with field name and filter value
gen_query(selecto, opts \\ [])
Returns an Ecto.Query with all your filters and selections added..eventually!
gen_sql(selecto)
group_by(selecto, groups)
Add to the Group By
order_by(selecto, orders)
Add to the Order By
select(selecto, fields)
add a field to the Select list. Send in one or a list of field names or selectable tuples TODO allow to send single, and special forms..