# `Selecto.Builder.Retarget`

SQL generation logic for Retarget functionality.

This module handles the construction of SQL queries that retarget from the source table
to a target table while preserving existing filters through subqueries.

# `build_join_chain_subquery`

```elixir
@spec build_join_chain_subquery(Selecto.Types.t(), Selecto.Types.retarget_config(), [
  atom()
]) ::
  {Selecto.Types.iodata_with_markers(), Selecto.Types.sql_params()}
```

Build the join chain subquery for connecting source to target.

# `build_retarget_query`

```elixir
@spec build_retarget_query(
  Selecto.Types.t(),
  keyword()
) :: Selecto.Types.builder_result()
```

# `extract_retarget_conditions`

```elixir
@spec extract_retarget_conditions(
  Selecto.Types.t(),
  Selecto.Types.retarget_config(),
  String.t()
) ::
  {Selecto.Types.iodata_with_markers(), Selecto.Types.sql_params()}
```

Extract retarget conditions from existing filters to construct the subquery.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
