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

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

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.

Callbacks

Link to this callback

build_query(query, builder, options)

View Source (optional)
@callback 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)
@callback using(options :: keyword()) :: Macro.t()

Called when QueryElf is used with the plugin.

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