In V1 of ojotas it is needed that the user specifies for each query where relations are being included which key is going to serve as the unique identifier of each object. This is important for deduping purposes
ie:
select j.jobNumber, jl.locationId, jl.dispatcherNotes from job j inner join job_location jl on j.jobId = jl.jobId;
We need to tell ojotas (manually) that jobNumber and locationId are the unique identifiers of those entities.
Another possibility would be that ojotas always include in the sql query the primary key of each object. Use that to do the assemble and then discard it so the user only gets what they asked for. Sequelize does this behind the scenes too to have better DX when manually specifying attributes.
In V1 of ojotas it is needed that the user specifies for each query where relations are being included which key is going to serve as the unique identifier of each object. This is important for deduping purposes
ie:
We need to tell ojotas (manually) that jobNumber and locationId are the unique identifiers of those entities.
Another possibility would be that ojotas always include in the sql query the primary key of each object. Use that to do the assemble and then discard it so the user only gets what they asked for. Sequelize does this behind the scenes too to have better DX when manually specifying attributes.