safe-typeorm
safe-typeorm copied to clipboard
Implement `bindAppJoin()` who supports the lazy app join
const group: BbsGroup = await BbsGroup.findOneOrFail();
safe.bindAppJoin(group);
const articleList: BbsArticle[] = await bbs.articles.get();
const top: BbsArticle = articleList[0];
await top.tags.get();
await top.comments.get();
await (await top.contents.get())[0].files.get();
// ANY SELECT QUERY WOULD BE OCCURED
// BECAUSE ALL OF THEM ALREADY BEEN LOADED BY
// LAZY APP JOIN
for (const article of articleList)
{
await article.tags.get();
await article.comments.get();
for (const content of article.contents.get())
await content.files.get();
}