friendship query that returns the other user object

I have two tables:
friendships:{id:uuid, sender: uuid, target: uuid, status: enum("accepted","pending")}

and
profiles:{id:uuid, username:string}

I want to query the friendships table for the local user id from the supabase client (supabase auth table syncs rows to the profiles table), and return an object like {id:friendship.id, status:friendship.status, user:profile} where the user is the other user, unfortunately most ai coding assistants dont have full or up to date knowledge of drizzle orms (including the one on the drizzle docs site) so is this possible with just drizzle syntax's and how can i do this ?
Was this page helpful?