Projection, with and array_agg
Hi, I have a "vehicule" table. Each vehicule has a collection of element. Each element has a detail in a separate table.
Vehicule
- vehicule_id
- label
VehiculeEquipement
- vehicule_id
- equipement_id
- price
Equipement
- equipement_id
- euipement_label
To retrieve a vehicule, I have this function: https://gist.github.com/bolbo/0eea9640a5b29c5c8d38 If I remove equipement_label from the projection in the WITH, I have my vehicule. But with equipement_label, I have a "Notice: Undefined offset: 11".
Can someone help me find the problem ? Thanks
The problem is similar to embedded entities. There are now ways for now to pass a projection as a type. We need to wrap types in a UnitOfTreatment that would either just be a type or a projection. That will be implemented in 2.1