vapor / fluent-kit

Swift ORM (queries, models, and relations) for NoSQL and SQL databases
MIT License
211 stars 116 forks source link

Eager-load filtering #227

Open brycesteve opened 4 years ago

brycesteve commented 4 years ago

When using eager loading, all relations are loaded. It would be useful, especially with a large number of relations, to be able to filter the returned relations. Perhaps something like this:

SomeModel.query(on: database)
    .with(\.$childModel) {
        $0.filter(\.$childProperty == "someValue")
    }
    .all()
AirZona commented 2 years ago

Any update on this? Would so love to have this. Thank you!

wibed commented 2 years ago

shameless bump

0xTim commented 2 years ago

This hasn't been approached yet. If someone wants to pick it up that would be awesome but it's likely to be bumped to the Fluent 5 feature list

mikaelacaron commented 5 months ago

Plus one to this! Just came across this issue when I was looking to do something similar

RobertKoval commented 5 months ago

up ⬆️