# `Selecto.EctoAdapter`

Ecto integration for Selecto query builder.

This module provides functionality to automatically configure Selecto
from Ecto schemas and repositories, making it easy to integrate with
Phoenix applications.

## Usage

    # Configure from Ecto repo and schema
    selecto = Selecto.EctoAdapter.configure(MyApp.Repo, MyApp.User)
    
    # With options
    selecto = Selecto.EctoAdapter.configure(MyApp.Repo, MyApp.User, 
      joins: [:posts, :comments],
      redact_fields: [:password_hash]
    )
    
    # Generate domain from schema
    domain = Selecto.EctoAdapter.schema_to_domain(MyApp.User)

# `configure`

Configure Selecto from an Ecto repository and schema.

## Parameters

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

## Options

- `:joins` - List of associations to include as joins (atoms)
- `:redact_fields` - List of fields to exclude from queries (atoms) 
- `:custom_columns` - Map of custom column definitions
- `:custom_filters` - Map of custom filter definitions
- `:extensions` - List of Selecto extension specs applied during domain build
- `:validate` - Whether to validate domain configuration (boolean)
- `:name` - Custom name for the domain (string)

## Examples

    # Basic usage
    selecto = Selecto.EctoAdapter.configure(MyApp.Repo, MyApp.User)
    
    # With joins and redacted fields
    selecto = Selecto.EctoAdapter.configure(MyApp.Repo, MyApp.User,
      joins: [:posts, :profile],
      redact_fields: [:password_hash, :email]
    )
    
    # With custom columns
    selecto = Selecto.EctoAdapter.configure(MyApp.Repo, MyApp.User,
      custom_columns: %{
        "full_name" => %{
          name: "Full Name",
          select: {:concat, ["first_name", {:literal, " "}, "last_name"]}
        }
      }
    )

# `get_associations`

Get available associations from an Ecto schema.

Returns a list of association names that can be used in joins.

# `get_fields`

Get field information from an Ecto schema.

Returns a map with field names and their types.

# `schema_to_domain`

Generate a Selecto domain configuration from an Ecto schema.

This function introspects the Ecto schema and generates a compatible
domain map for Selecto configuration.

## Parameters

- `schema` - The Ecto schema module
- `opts` - Configuration options (see `configure/3`)

## Returns

A domain map compatible with `Selecto.configure/2`

---

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