AbacusSql (abacus_sql v2.0.0) View Source

Link to this section Summary

Link to this section Types

Link to this section Functions

Specs

group_by(Ecto.Query.t(), t()) :: Ecto.Query.t()

Specs

having(Ecto.Query.t(), t()) :: Ecto.Query.t()

Adds the given filter to the havings list.

Make sure that the query has at least one group_by clause.

The advantage is that it can filter inside has_many assocs using aggregation such as count, min or max.

For example: having(BlogPost, "count(author.posts.id) > 10") would filter for blog posts whose authors have at least 10 posts.

Link to this function

order_by(query, term, ascending? \\ true)

View Source

Specs

order_by(Ecto.Query.t(), t(), boolean()) :: Ecto.Query.t()

Specs

scope(Ecto.Query.t(), [
  {atom(), term() | %{__struct__: module(), __meta__: Ecto.Schema.Metadata.t()}}
]) :: Ecto.Query.t()
Link to this function

scope(query, key, value)

View Source

Specs

scope(
  Ecto.Query.t(),
  atom(),
  term() | %{__struct__: module(), __meta__: Ecto.Schema.Metadata.t()}
) :: Ecto.Query.t()
Link to this function

select(query, key, term)

View Source

Specs

select(Ecto.Query.t(), atom() | String.t(), t()) :: Ecto.Query.t()

Specs

where(Ecto.Query.t(), t()) :: Ecto.Query.t()