Include user metadata in the first insert for objects
In order to be able to use passed in user metadata for INSERT RLS policies, the user metadata should be included in the first insert request. Currently, the first insert request doesn't have any user metadata set.
See https://discord.com/channels/839993398554656828/1338777324845404262/1338777324845404262 for more context
This has come up before with at least 1 or 2 users.
Cant see whats behind the discord link but think I might be running into this issue as well.
const { error } = await supabase.storage
.from(uploadUrlData.bucket)
.uploadToSignedUrl(uploadUrlData.path, uploadUrlData.token, file, {
upsert: true,
metadata: uploadUrlData.metadata
});
Results in the file being uploaded, and an object. However, none of the metadata is actually set in the table. Not in the metadata or user_metadata column
+1 This sounds like a great function that opens up a lot of possibilities. If the metadata were inserted into the table when the first insert occurred, it could be used in RLS, triggers, etc.
& this feature has been supported by S3, Azure, GCS and among all major storage providers