Flittering API Request For Storage And Bucket #22709
Unanswered
Adatik
asked this question in
Feature Requests
Replies: 3 comments 2 replies
|
You can make REST API calls using standard database functions using .schema('storage') in your request. This allows you to gather info on files from storage.objects. You CANNOT delete rows directly from that table though and need to use the Storage API for the operations or you will orphan the s3 data. |
0 replies
|
The idea and best example is like creating Instgram story, which means the image will be available only 24 hours then it's gone. I know we can do filtering in API database in order to hide the image older than 24 hours. But the best way also if we could delete the image from the storage after 24 hours instead of saving the image in the storage forever. Because the image is no longer needed. Also to free some spacing in the storage.
Here is sample scenario, image created in user side, we have our cron job to run every day if the storage image created date is less than today then delete the image by using flitting API storage.
… On Apr 14, 2024, at 4:41 PM, GaryAustin1 ***@***.***> wrote:
You can make REST API calls using standard database functions using .schema('storage') in your request. This allows you to gather info on files from storage.objects. You CANNOT delete rows directly from that table though and need to use the Storage API for the operations or you will orphan the s3 data.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
1 reply
|
Since it's self-set up and it is kind of hard for people who don't have that much experience in coding I recommend that:
Add a parameter or body data type so that we can pass the expired date “second” of the file and if the “file, image, video, etc” reaches the expired time it will be deleted automatically from your side. This can be an optional parameter if the value is not empty then the file will be deleted in time. And to make it easy apply this As API or any type of code.
This will be helpful since you did the heavy lifting for the Supabase user.
Also, I don't know if this future is available or not but if yes please provide me with the guide as an API reference.
… On Apr 14, 2024, at 10:11 PM, GaryAustin1 ***@***.***> wrote:
Yes you can do that with cron and call the storage api with http or pg_net.
This repository shows doing that based on the file being "marked" delete, but you could use an filter to decide what to delete.
https://github.com/GaryAustin1/supa-file-helper
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In some cases, we need to filter API storage by available data such as in a database.
The best example of this is if we want to automatically delete an object older than a certain time period.
All reactions