# `Lotus.Query.Sort`
[🔗](https://github.com/typhoonworks/lotus/blob/v0.16.4/lib/lotus/query/sort.ex#L1)

Represents a sort directive to apply on query results.

Sorts are source-agnostic data structures that describe a column-level
ordering. Each source adapter knows how to translate sorts into its
native query language (e.g., SQL ORDER BY clauses).

## Examples

    %Sort{column: "created_at", direction: :desc}
    %Sort{column: "name", direction: :asc}

# `direction`

```elixir
@type direction() :: :asc | :desc
```

# `t`

```elixir
@type t() :: %Lotus.Query.Sort{column: String.t(), direction: direction()}
```

# `direction_label`

```elixir
@spec direction_label(direction()) :: String.t()
```

Returns a human-readable label for the given direction.

# `directions`

```elixir
@spec directions() :: [direction(), ...]
```

Returns the list of valid direction atoms.

# `new`

```elixir
@spec new(String.t(), direction()) :: t()
```

Creates a new sort, validating the direction.

---

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