Answer the question
In order to leave comments, you need to log in
How to form createQueryBuilder in typeorm?
There was such a query in typeorm 0.2 version
const topic = await Topic.query(`
select
t.*,
f.user_id user_followed_id,
m.user_id user_moderator_id
from topic t
left join follow f on f.topic_id = t.id and f.user_id = $1
left join moderator m on m.topic_id = t.id and m.user_id = $2
where t.title = $3`;
const topic = await AppDataSource
.getRepository(Topic)
.createQueryBuilder("topic")
.getOne()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question