# `Selecto.Configuration`

Domain configuration and initialization for Selecto.

This module handles the setup and configuration of Selecto instances,
including domain validation, connection pooling, and adapter initialization.

# `configure`

```elixir
@spec configure(Selecto.Types.domain(), term(), keyword()) :: Selecto.Types.t()
```

Generate a Selecto structure from a domain configuration and connection input.

## Parameters

- `domain` - Domain configuration map (see domain configuration docs)
- `connection_input` - Adapter-specific connection options, an Ecto repo,
  a live connection pid/name, or a pooled connection reference.
- `opts` - Configuration options

## Options

- `:validate` - (boolean, default: true) Whether to validate the domain configuration
- `:pool` - (boolean, default: false) Whether to enable connection pooling
- `:pool_options` - Connection pool configuration options
- `:adapter` - (module, default: `SelectoDBPostgreSQL.Adapter`) Database adapter module
- `:rollup_sort_fix` - (`true | false | :auto`, default: `:auto`) whether to
  wrap `GROUP BY ROLLUP ... ORDER BY` queries in a compatibility subquery;
  `:auto` disables the wrapper on PostgreSQL 18+

## Examples

    # Basic usage (validation enabled by default)
    selecto = Selecto.Configuration.configure(domain, connection_input)

    # With connection pooling
    selecto = Selecto.Configuration.configure(domain, connection_input, pool: true)

    # Disable validation for performance
    selecto = Selecto.Configuration.configure(domain, connection_input, validate: false)

# `configure_domain`

```elixir
@spec configure_domain(Selecto.Types.domain()) :: Selecto.Types.processed_config()
```

Generate the selecto configuration from a domain map.

Processes domain configuration to extract fields, joins, and filters.
This is called internally during configure/3.

# `configure_domain`

```elixir
@spec configure_domain(Selecto.Types.domain(), [{module(), keyword()}]) ::
  Selecto.Types.processed_config()
```

# `from_ecto`

```elixir
@spec from_ecto(module(), module(), keyword()) :: Selecto.Types.t()
```

Configure Selecto from an Ecto repository and schema.

This convenience function automatically introspects the Ecto schema
and configures Selecto with the appropriate domain and database connection.

## Parameters

- `repo` - The Ecto repository module (e.g., MyApp.Repo)
- `schema` - The Ecto schema module to use as the source table
- `opts` - Configuration options (passed to EctoAdapter.configure/3)

## Examples

    # Basic usage
    selecto = Selecto.Configuration.from_ecto(MyApp.Repo, MyApp.User)

    # With joins and options
    selecto = Selecto.Configuration.from_ecto(MyApp.Repo, MyApp.User,
      joins: [:posts, :profile],
      redact_fields: [:password_hash]
    )

---

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