QueryElf.Plugin behaviour (query_elf v0.3.1) View Source

A behaviour to be followed when creating plugins that extends the query builders functionality.

Link to this section Summary

Callbacks

Takes the query, the builder, and the options given to the build_query function build the query as arguments. Should return the modified query.

Called when QueryElf is used with the plugin.

Link to this section Callbacks

Link to this callback

build_query(query, builder, options)

View Source (optional)

Specs

build_query(
  query :: Ecto.Query.t(),
  builder :: module(),
  options :: QueryElf.options()
) :: Ecto.Query.t()

Takes the query, the builder, and the options given to the build_query function build the query as arguments. Should return the modified query.

Link to this callback

using(options)

View Source (optional)

Specs

using(options :: keyword()) :: Macro.t()

Called when QueryElf is used with the plugin.

Should be used to inject required code in the builder module.