Future plans for storage using object.ID? #4303
Replies: 12 comments 18 replies
-
Are you sure deleting the file object from the object table deletes the file in storage? I've not seen any change on this and in the past if you delete the row in the object table directly, you "orphan" the file in storage. I use the http extension to delete files on a trigger if the object (a note in my case) is deleted and has a file attached to it. I have no confidence this would work for a mass delete, of say a user and all his notes, so still have to solve that with a function running external to the db. |
Beta Was this translation helpful? Give feedback.
-
Hi all. I wonder the same. After uploading a file I'd like to get the Object Id to update the related record's foreign key with it. When it comes to Db, it is possible to chain a Thanks! |
Beta Was this translation helpful? Give feedback.
-
To anyone that might stumble on this in the future, this problem is already solved, here's the PR that was merged, a changelog was also published on july 7 2023. |
Beta Was this translation helpful? Give feedback.
-
That's great news! It covers the first point of the original message from @RickMeasham. What about the second one? Any news on that? Getting the Id of the file uploaded is cool, but it would be even cooler to be able to use it to download or get the public url of that file later :) |
Beta Was this translation helpful? Give feedback.
-
It is very nice that it is now possible via the API but unfortunately, the client libraries haven't been updated to match this. @GaryAustin1 how were you able to retrieve the Also if there is no way at the moment with the standard |
Beta Was this translation helpful? Give feedback.
-
Hey there! I'd like to follow-up. Is it possible now to get the user id through the Javascript Library?
Something like this below, which would be attached to the file uploaded to S3.
|
Beta Was this translation helpful? Give feedback.
-
Yes, would be a lot more convenient ensuring integrity. Would be glad, if we can have an update on this. |
Beta Was this translation helpful? Give feedback.
-
Long story short: when I use the sdk for storage, we assign the id to the file that's uploaded but basically no easy way to return it as part of creation process. any update on this? This makes it difficult for me to reference things on the backend or front-end of my next.js application |
Beta Was this translation helpful? Give feedback.
-
Hi all, I don't know since when this is available, but today when I tried storing a new file, it returned some of the attributes of the newly stored filed in the Thanks! |
Beta Was this translation helpful? Give feedback.
-
It would be nice to retrieve objects by ID in some function like: const { data } = supabase.storage.from('movie-posters').getObjectById(this.myUuid) Any updates regards this subject? |
Beta Was this translation helpful? Give feedback.
-
Yes, it's painful to create my own unique id while there is already one in supabase system! |
Beta Was this translation helpful? Give feedback.
-
+1 for cascade deletes in storage, and methods to interact with files by ID (instead of paths). This feels like a super common use case. |
Beta Was this translation helpful? Give feedback.
-
Hi folks,
I was really excited yesterday to discover that I can now create a foreign key to the
objects
table.The beauty of using a foreign key to the objects table is that I can cascade a delete and remove files when when the parent record is deleted. (Eg. delete a user and their avatar is removed)
However I note that all the storage methods insist on bucket and filename still. Using this for
upload
makes sense as it allows for URLs that have a sensical filename for downloading. But once a file is uploaded, it would be far nicer if I could just use theobject.id
Are there any plans to
upload
call?download
createSignedURL
etc?Thanks
Beta Was this translation helpful? Give feedback.
All reactions