Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Implement bindAppJoin() who supports the lazy app join #51

Open
samchon opened this issue Feb 1, 2022 · 0 comments
Open

Implement bindAppJoin() who supports the lazy app join #51

samchon opened this issue Feb 1, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@samchon
Copy link
Owner

samchon commented Feb 1, 2022

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();
}
@samchon samchon added the enhancement New feature or request label Feb 1, 2022
@samchon samchon self-assigned this Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant