Supabase.Storage.SearchOptions (supabase_storage v0.3.0)

Represents the search options for querying objects within Supabase Storage.

This module encapsulates various options that aid in fetching and sorting storage objects. These options include specifying the limit on the number of results, an offset for pagination, and a sorting directive.

Structure

A SearchOptions consists of the following attributes:

  • limit: Specifies the maximum number of results to return. Default is 100.
  • offset: Specifies the number of results to skip before starting to fetch the result set. Useful for implementing pagination. Default is 0.
  • sort_by: A map that provides a sorting directive. It defines which column should be used for sorting and the order (ascending or descending). Default is %{column: "name", order: "asc"}.

Functions

  • parse!/1: Accepts a map of attributes and constructs a structured SearchOptions.

Examples

Parsing search options

search_attrs = %{
  limit: 50,
  offset: 10,
  sort_by: %{column: "created_at", order: "desc"}
}
Supabase.Storage.SearchOptions.parse!(search_attrs)

Summary

Types

@type t() :: %Supabase.Storage.SearchOptions{
  limit: integer(),
  offset: integer(),
  sort_by: %{column: String.t(), order: String.t()}
}

Functions

@spec parse!(map()) :: t()