Mutare.Ecto.Host (mutare_ecto v0.1.1)

Copy Markdown View Source

Builds selector-host targets for localized Ecto query conditions.

The companion Mutare.Ecto.Host.Routing identifies hosted argument positions. This module then coordinates four focused components: Host.Condition locates the condition argument a where/having call owns, Host.Bindings interprets Ecto binding declarations, Host.Catalog produces the logical mutants — the plugin's own SQL catalog plus the pin interiors Mutare.Ecto.Island sub-contracts to core (which is why context threads down to the catalog) — and Host.Target constructs the dynamic/2 wrap and selector splice consumed by Mutare core.

Besides conditions, the host also weaves the :bound ±1 bump of a literal limit/offset value, as a pin-only target with no dynamic/2 wrap and no bindings — see Mutare.Ecto.Bound, the bump catalog and its literal guard. In a from, only the effective occurrence of a repeated bound weaves (Mutare.Ecto.AST.FromCall.effective_clause?/2).

Summary

Functions

Mutare.Mutator.MacroHost.host/2: the selector-host targets for a resolved Ecto.Query macro call. The call's node is re-read through Mutare.Ecto.AST.QueryCall so the splice transforms rebuild the author's written form. Core's context is unpacked once here, into the plugin's %Mutare.Ecto.Context{} — this is the hosted path's core boundary, as Mutare.Ecto.Dispatcher.mutations/2 is the mutate/2 path's.

Functions

host(call, context)

@spec host(Mutare.CallRouting.Call.t(), Mutare.Mutator.context()) :: [
  Mutare.Ecto.Host.Target.t()
]

Mutare.Mutator.MacroHost.host/2: the selector-host targets for a resolved Ecto.Query macro call. The call's node is re-read through Mutare.Ecto.AST.QueryCall so the splice transforms rebuild the author's written form. Core's context is unpacked once here, into the plugin's %Mutare.Ecto.Context{} — this is the hosted path's core boundary, as Mutare.Ecto.Dispatcher.mutations/2 is the mutate/2 path's.