Supabase Storage Client
This is a Rust client library for interacting with Supabase Storage, allowing you to perform various operations such as uploading, downloading, and managing files in your Supabase Storage bucket.
Getting Started
To use the Supabase Storage Rust client, you'll need to first create a Storage
instance with your Supabase configuration.
Make sure to set the required environment variables before using the client library. You can use dotenv
to load the environment variables from a .env
file.
The SupabaseConfig assumes the presence of the variables SUPABASE_URL_STORAGE and SUPABASE_API_KEY, ensuring that both the authorization header and the base URL are appropriately configured.
use Storage;
use SupabaseConfig;
use dotenv;
async
Utilizing the SupabaseConfig struct isn't obligatory. Alternatively, you can manually load the storage URL and API key values.
use HeaderValue;
use Storage;
use Deserialize;
async
get a File
To get a file from Supabase Storage, you can use the get_object
method of the Storage
instance.
use Storage;
use SupabaseConfig;
use dotenv;
async
Updating an Object
You can also update an object in the bucket using the update_object
method.
The update method is only async for now.
use Storage;
use SupabaseConfig;
use dotenv;
async
For those who prefer working with objects, rather than using the execute function, the execute_from function can be utilized, allowing for the subsequent parsing of the response.
use dotenv;
use Storage;
use SupabaseConfig;
use Deserialize;
async
Contributing
Calling all brilliant minds and passionate developers! 🚀 Feel free to join and make a difference in the project!
License
This library is licensed under the MIT License. See the LICENSE file for more details.
Feel free to add more examples and documentation to this readme based on your specific use cases and requirements.