-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description
A lot of datatypes have refs to other objects consisting of core id + version id. This is needed to get a doc from another collection (basically a join). Right now consumers of core need to do these joins at the application level which can be complex when there's several fields to manage accross queries. We should provide a way to hydrate these refs at the getMany or getById level.
e.g. dream API:
project.observation.getByDocId(docId, { include: { track: true })Tasks
(TODO: Bikeshed approach)
- Settle on API for consumers (I think a list of fields to
hydratewould be useful - Add metadata to schema to define ref table names
- Add first class notion of "datatype registry" to look up other tables to do joins on.
- Figure out TS shenanigans to add de-ref'd fields for each ref'd field to datatype returns.
- Nested deref
- in-memory cache for
getManyto reduce queries - real SQL joins? https://orm.drizzle.team/docs/joins (probs not)
Metadata
Metadata
Assignees
Labels
No labels