Skip to content

expose metadata from storage #1160

@stevenctl

Description

@stevenctl

Is your feature request related to a problem? Please describe.

Storage objects can have associated metadata, this was solved in supabase/storage#439. However, there is nothing in the dart/flutter API that exposes this metadata.

Describe the solution you'd like

Download would need to have a new response type or another method would need to be added:

// old
Future<Uint8List> download(String path, {TransformOptions? transform})

// new method
Future<StorageResponse> downloadWithMetadata(String path, {TransformOptions? transform});

class StorageResponse {
  Uint8List data;
  Map<string, dynamic> metadata; 
}

Similarly, upload needs additional parameters (or new fields in FileOptions?) to allow writing to metadata

Future<String> upload(
  String path,
  File file, {
  FileOptions fileOptions = const FileOptions(),
  int? retryAttempts,
  StorageRetryController? retryController,
})

Describe alternatives you've considered

Managing my own metadata separately from the storage objects. I'm not a fan of this; the storage schema has a metadata column per object.

Additional context

https://supabase.com/docs/guides/storage/schema/design

This is implemented in the javascript and python libraries afaict:

supabase/storage-py#328

supabase/storage-js#207

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions