simolus3 / drift

Drift is an easy to use, reactive, typesafe persistence library for Dart & Flutter.
https://drift.simonbinder.eu/
MIT License
2.67k stars 372 forks source link

Document whether using `computedField` on a reference column will join the referenced table or not #3334

Open AhmedLSayed9 opened 2 weeks ago

AhmedLSayed9 commented 2 weeks ago

At referencing-other-tables section, it has a note for Filter on foreign keys: "when filtering on a reference column, drift will apply the filter to the column itself instead of joining the referenced table."

At computed-fields section, it just mentions "You can write expressions which reference other columns in the same table or even other tables. The joins will be created automatically by the manager." But, it doesn't mention whether the computedField (on a reference column like id) will join the referenced table or not. i.e:

final todoCategoryId = db.managers.todoItems.computedField((o) => o.category.id);
simolus3 commented 1 week ago

cc @dickermoshe