Supabase.Storage.FileHandler (supabase_storage v0.4.2)

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

bucket_id()

@type bucket_id() :: String.t()

file_path()

@type file_path() :: Path.t()

object_path()

@type object_path() :: Path.t()

opts()

@type opts() :: Supabase.Storage.FileOptions.t()

prefix()

@type prefix() :: String.t() | nil

search_opts()

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

token()

@type token() :: String.t()

wildcard()

@type wildcard() :: String.t()

Functions

copy(client, bucket_id, path, to, dest)

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

create_file_to_url(client, bucket, token, object_path, file_path, opts)

create_signed_url(client, bucket_id, path, opts)

create_upload_signed_url(client, bucket_id, path, opts)

@spec create_upload_signed_url(
  Supabase.Client.t(),
  bucket_id(),
  object_path(),
  keyword()
) ::
  Supabase.result(Supabase.Fetcher.Response.t())

exists(client, bucket_id, path)

get(client, bucket_id, wildcard, transform)

get_info(client, bucket_id, wildcard)

get_lazy(client, bucket_id, wildcard, transform)

get_lazy(client, bucket_id, wildcard, transform, on_response)

list(client, bucket_id, prefix, opts)

move(client, bucket_id, path, to, dest)

remove_list(client, bucket_id, paths)