Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide consistent naming between data returned form storage upload and equivalent storage.objects field #135

Open
emmnull opened this issue Dec 12, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@emmnull
Copy link

emmnull commented Dec 12, 2022

Feature request

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

Not really a problem, but more of a consistency concern. Is there a reason why the data returned by a storage upload and the storage.objects's table field holding the same value aren't named consistently?

An upload response's data contains a path string, whereas the same value is held under a name column in the storage.objects table.

const storageRes = await db.storage
  .from('someBucket')
  .upload('some/path/to/a/file.webp', buffer, {contentType: 'image/webp'})
// storageRes: {
//    data: {
//        path: string;
//        ^^^^
//    };
//    error: null;
//} | {
//    data: null;
//    error: StorageError;
//}

I understand that the data returned is not necessarily resulting form a select on the objects table, but since the values are identical (in all cases?), maybe giving the same name to both would ensure a clearer assessment of their equivalence in developpers' mental models.

Describe the solution you'd like

Name both the concerned column and the data prop identically.

Describe alternatives you've considered

Keep things as they are. This really isn't a critical thing.

Additional context

Add any other context or screenshots about the feature request here.

@emmnull emmnull added the enhancement New feature or request label Dec 12, 2022
@soedirgo soedirgo transferred this issue from supabase/supabase-js Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant