Skip to content

relationLoadStrategy documentation is insufficient #9356

@rbutera

Description

@rbutera

Documentation Issue

What was unclear or otherwise insufficient?

TypeORM has introduced a relationLoadStrategy option in 0.3.x

To quote the release notes:

- added new option on relation load strategy called relationLoadStrategy.
Relation load strategy is used on entity load and determines how relations must be loaded when you query entities and their relations from the database.
Used on find* methods and QueryBuilder. Value can be set to join or query.

join - loads relations using SQL JOIN expression
query - executes separate SQL queries for each relation
Default is join, but default can be set in ConnectionOptions:

    createConnection({
        /* ... */
        relationLoadStrategy: "query"
    })

Also, it can be set per-query in find* methods:

    userRepository.find({
        relations: {
            photos: true
        }
    })

However, as you can see above, the example in find methods does not actually demonstrate how to use relationLoadStrategy

Furthermore, it is missing from the documentation on TypeORM.io

Recommended Fix

  1. add an explanation to typeorm.io
  2. fix the release notes

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️ Yes, I have the time, and I know how to start.
  • ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions