Just trying to do a simple inner join as json.
model
posts (author is fk to profiles.id)
id
author
title
...
profiles
id
displayName
...
Trying to do a simple join so that:
select * from posts
(join profiles on profiles.id = posts.author -- as json?)
so that my result would look like:
id | title | author | .. |
---|---|---|---|
1 | some title 1 | { id: 02xx, displayName: 'Jon', username: 'jon1' } | |
2 | some title 2 | { id: 02xx, displayName: 'Jon', username: 'jon1' } |
I feel like there is a very simple way to do this?
J