Supabase.Storage.ObjectHandler (supabase_storage v0.3.0)

A low-level API interface for managing objects within a Supabase bucket.

Responsibilities

  • File Management: Create, move, copy, and get information about files in a bucket.
  • Object Listing: List objects based on certain criteria, like a prefix.
  • Object Removal: Delete specific objects or a list of objects.
  • URL Management: Generate signed URLs for granting temporary access to objects.
  • Content Access: Retrieve the content of an object or stream it.

Usage Warning

This module is meant for internal use or for developers requiring more control over object management in Supabase. In general, users should work with the higher-level Supabase.Storage API when possible, as it may offer better abstractions and safety mechanisms.

Directly interfacing with this module bypasses any additional logic the main API might provide. Use it with caution and ensure you understand its operations.

Summary

Types

Link to this type

bucket_name()

@type bucket_name() :: String.t()
@type file_path() :: Path.t()
Link to this type

object_path()

@type object_path() :: Path.t()
@type prefix() :: String.t()
Link to this type

search_opts()

@type search_opts() :: Supabase.Storage.SearchOptions.t()
@type wildcard() :: String.t()

Functions

Link to this function

copy(client, bucket_id, path, to)

@spec copy(Supabase.Client.t(), bucket_name(), object_path(), object_path()) ::
  {:ok, :copied} | {:error, String.t()}
Link to this function

create_file(client, bucket, object_path, file_path, opts)

@spec create_file(Clien.t(), bucket_name(), object_path(), file_path(), opts()) ::
  {:ok, Supabase.Storage.Object.t()} | {:error, String.t()}
Link to this function

create_signed_url(client, bucket_name, path, expires_in)

@spec create_signed_url(Supabase.Client.t(), bucket_name(), object_path(), integer()) ::
  {:ok, String.t()} | {:error, String.t()}
Link to this function

get(client, bucket_name, wildcard)

@spec get(Supabase.Client.t(), bucket_name(), object_path()) ::
  {:ok, binary()} | {:error, String.t()}
Link to this function

get_info(client, bucket_name, wildcard)

@spec get_info(Supabase.Client.t(), bucket_name(), wildcard()) ::
  {:ok, Supabase.Storage.Object.t()} | {:error, String.t()}
Link to this function

get_lazy(client, bucket_name, wildcard)

@spec get_lazy(Supabase.Client.t(), bucket_name(), wildcard()) ::
  {:ok, Stream.t()} | {:error, atom()}
Link to this function

list(client, bucket_name, prefix, opts)

@spec list(Supabase.Client.t(), bucket_name(), prefix(), search_opts()) ::
  {:ok, [Supabase.Storage.Object.t()]} | {:error, String.t()}
Link to this function

move(client, bucket_id, path, to)

@spec move(Supabase.Client.t(), bucket_name(), object_path(), object_path()) ::
  {:ok, :moved} | {:error, String.t()}
Link to this function

remove(client, bucket_name, path)

@spec remove(Supabase.Client.t(), bucket_name(), object_path()) ::
  {:ok, :deleted} | {:error, String.t()}
Link to this function

remove_list(client, bucket_name, paths)

@spec remove_list(Supabase.Client.t(), bucket_name(), [object_path()]) ::
  {:ok, :deleted} | {:error, String.t()}