Hi, i'm new to supabase and trying it with my firs...
# help
d
Hi, i'm new to supabase and trying it with my first project now. I creating a images gallery. And I have created a table, with a column (img), but i have also created a storage, how could I upload images to storage, so I can later use them in maybe the table or on my next js page? I don't really know how to connect the folders/images i store in storage to my table or next application.
n
Hello @Dembe! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
j
Hey @Dembe , if you take a look at https://supabase.com/docs/guides/storage#policy-examples You can see that the storage uses Postgres. So you can access it like any other part of supabase. However I think the storage is in its own schema so you may want to create a trigger function which updates a table you’ve created in your public schema so you can access it using supabasejs
d
Alright, thanks for answer. Need to read and trying out and see if I can figure it out. 😄
g
It sounds like what you want to do is save the path name of the file in your own tables and then use that to get your file. You can put a trigger on storage objects table, but an upload actually does an insert, then stores the file to s3 and then if that succeeds an update. BUT it can actually do a delete on objects table if the s3 store fails. So to trigger you would have to deal with deletes too.