Haytni.TrackablePlugin.QueryHelpers (Haytni v0.7.0) View Source
This module provides some basic helpers to query connections to be independant and not have to know the internals of the Trackable plugin.
Link to this section Summary
Functions
Composes query to filter on connection between an interval
Composes query to filter on connection date
Composes query to filter on ip address
Returns a queryable for all invitations
Returns a queryable for all connections of user
Link to this section Functions
Specs
and_where_date_between( query :: Ecto.Queryable.t(), first :: nil | Date.t() | DateTime.t() | NaiveDateTime.t(), last :: nil | Date.t() | DateTime.t() | NaiveDateTime.t() ) :: Ecto.Query.t()
Composes query to filter on connection between an interval
Specs
and_where_date_equals( query :: Ecto.Queryable.t(), date :: Date.t() | DateTime.t() | NaiveDateTime.t() ) :: Ecto.Query.t()
Composes query to filter on connection date
Specs
and_where_ip_equals(query :: Ecto.Queryable.t(), ip :: String.t()) :: Ecto.Query.t()
Composes query to filter on ip address
Specs
connections_from_all(user :: Haytni.user()) :: Ecto.Query.t()
Returns a queryable for all invitations
Note: user is not used for the query, just to find the scope/table/association
Specs
connections_from_user(user :: Haytni.user()) :: Ecto.Query.t()
Returns a queryable for all connections of user