Reputation: 592
I have three tables in my social media app: users
(stores user details), connections
, and posts
.
The connections
table has the following columns:
id
(Primary Key)uuid
(Foreign Key from users
table)circle
(List of UUIDs)following
(List of UUIDs)followers
(List of UUIDs)The posts
table has the following columns:
id
(Primary Key)uuid
(Foreign Key from users
table)created_at
(Timestamp)is_public
(Boolean)content
I need assistance with the following scenarios:
Scenario: Retrieving posts from users I'm following
Scenario: Handling private posts visible to specific users
How can I achieve the required outcome in Flutter Supabase?. Thank you!
Upvotes: 0
Views: 1040
Reputation: 18680
Any complex queries like this will require you to write database functions and calling it with the .rpc() method from the Flutter app.
final data = await supabase.rpc('get_following_posts');
Upvotes: 0