# `Selecto.Output.Transformers.Maps`

Transforms query results to list of maps format.

Supports various key types (strings, atoms, existing atoms) and key transformations
(camelCase, snake_case). Also supports type coercion from database types to Elixir types.

# `stream_transform`

Stream transformation for large datasets.

Returns a stream that transforms rows in batches to avoid loading
all data into memory at once.

# `transform`

```elixir
@spec transform(list(), list(), map(), keyword()) :: {:ok, [map()]} | {:error, term()}
```

Transform rows, columns, and aliases to list of maps.

## Parameters

- `rows` - List of row data (list of lists)
- `columns` - List of column names
- `aliases` - Map of column aliases
- `options` - Transformation options

## Options

- `:keys` - Key type (`:strings`, `:atoms`, `:existing_atoms`). Default: `:strings`.
  Both atom modes only use atoms that already exist; unknown names remain strings.
- `:transform` - Key name transformation (:none, :camelCase, :snake_case). Default: :none
- `:coerce_types` - Whether to coerce database types to Elixir types. Default: false
- `:null_handling` - How to handle NULL values (:preserve, :remove). Default: :preserve

## Examples

    # String keys (default)
    {:ok, maps} = transform(rows, columns, aliases, [])
    # => [%{"name" => "John", "age" => 25}, ...]

    # Atom keys
    {:ok, maps} = transform(rows, columns, aliases, keys: :atoms)
    # => [%{name: "John", age: 25}, ...]

    # CamelCase transformation
    {:ok, maps} = transform(rows, columns, aliases, keys: :atoms, transform: :camelCase)
    # => [%{firstName: "John", userAge: 25}, ...]

# `transform_with_types`

```elixir
@spec transform_with_types(list(), list(), map(), keyword()) ::
  {:ok, [map()]} | {:error, term()}
```

Transform rows with type coercion based on database column types.

This is a more advanced version that can coerce database types to proper Elixir types
based on PostgreSQL column type information.

---

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