-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Announcing the Supabase Integration #445
Comments
Awesome 🎉 Thanks for all the work you put into this @tshedor! I enjoyed the collaboration. This is a big win for the Flutter developer community. |
@tshedor hello! Thank you very much for your work. I am trying to use this technology stack in a Flutter app. As I understand, that could be used instead of Riverpod\Bloc for requests and persistence. My question is, what is the best practice to still use Supabase auth / edge functions along side it? I only see direct db usage, like What would you recommend? Maybe you could show a quick code snippet for it? Thank you once again! |
@ivanburlakov thanks for the comment.
Real quick, I want to clarify that Brick is not inherently stateful - you should still use a state manager like Riverpod or Bloc. These state managers should call out to Brick to populate their data.
Use By default, Brick will retry function requests, but it will not retry auth or storage requests (this default behavior can be configured). When you initialize Brick using the offline client, it attaches the offline client to the |
Brick has a first-party integration with Supabase, the open-source Firebase alternative with exponential momentum. After being heavily requested in #359 , the first stable release has finally landed on pub.dev.
Quick Start
Adding a Supabase provider to your repository is almost identical to adding a REST or GraphQL provider. You'll need just a little extra sauce to integrate an offline queue that will retry requests made while your app was offline:
Associations
Brick will generate all the necessary code for retrieving and upserting associations as well as other fields:
Querying
Association querying with Supabase is automatically handled, even for nested queries:
Note that not all of Supabase's extensive PostgREST operators are handled.
Creating
All associations of a model are upserted behind the scenes. You only need to upsert the parent model to ensure its dependencies also reach Supabase:
Testing
Quickly mock your Supabase endpoints to add uncluttered unit testing:
Like the rest of Brick's domains, the Supabase integration brings straightforward offline capability to your app. Give it a spin and let us know how it works for you.
Finally, many thanks to @devj3ns for the extremely patient and thorough testing of the beta and alpha releases. We had a lot of back and forth on every issue and PR in #401 , so there will definitely never be a production bug.
The text was updated successfully, but these errors were encountered: