Storage public URL

I have a trigger and a function that populates public.photos table when file is uploaded

begin
    insert into public.photos (id, file_path, bucket_id)
    values (new.id, new.name, new.bucket_id);
    return null;
end;


public.photos contains column file_url; how can I dump public url into that column when file is uploaded?
Was this page helpful?