mmvergara / supadart

Typesafe queries in Supabase Flutter! Generate Flutter / Dart 🎯 classes from your Supabase schema.
https://supadart.vercel.app
MIT License
43 stars 5 forks source link

feat: add storage client extension generator #87

Closed bookshiyi closed 1 month ago

bookshiyi commented 1 month ago

We could get bucket list from {SUPABASE_URL}/storage/v1/bucket, like this:

[
    {
        "id": "avatars",
        "name": "avatars",
        "owner": "",
        "public": false,
        "file_size_limit": null,
        "allowed_mime_types": null,
        "created_at": "2024-09-23T00:51:09.228Z",
        "updated_at": "2024-09-23T00:51:09.228Z"
    },
    {
        "id": "covers",
        "name": "covers",
        "owner": "",
        "public": false,
        "file_size_limit": null,
        "allowed_mime_types": null,
        "created_at": "2024-09-21T15:06:45.988Z",
        "updated_at": "2024-09-21T15:06:45.988Z"
    }
]

This branch will generate storage client code additional according to the json, like this:

// Supabase Storage Client Extension
extension SupadartStorageClient on SupabaseStorageClient {
  StorageFileApi get avatars => from('avatars');
  StorageFileApi get covers => from('covers');
}
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
supabase-schema-dart-class-generator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 9:19am
mmvergara commented 1 month ago

Wow we can also do storage.. Thanks again!, will merge this in a bit!