You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating structures being tied to one another in a many-to-many or one-to-many relationship in fast-check is not trivial. While feasible it requires our users to come up with advanced and complex options. The two tickets below are asking for it:
As the case is pretty general, we should probably come up with a built-in utility hiding all this complexity and able to generate a simple database content based on a provided schema. The helpers for many-to-many and many-to-one initiated by @gruhn sounds like great ideas to start to think of it.
Disclaimer: while the issue has been opened, there is no certainty that there will be a built-in helpers for that purpose, but at least we can start thinking of it: api, implem...
The text was updated successfully, but these errors were encountered:
At some point it makes me thinking to letrec even if 1. letrec does not support such need 2. the drafted code below would not work. But I feel having it in mind can help to draft a potential API:
constdataset=fc.dataset((tie)=>({// first tabledepartment: fc.record({id: fc.uuidV4(),name: fc.string(),}),// second tableemployee: fc.record({id: fc.uuidV4(),departmentId: tie('department','id'),// we will also need optional, many... maybe nested propertiesfirstName: fc.string(),lastName: fc.string(),}),}))
Maybe to ease our task, the internal declarations should not be wrapped within records. Indeed records will hide us what's could be actionable to get proper info on how to create the id of department. By dropping it we could possibly know enough on the two nested structures to magically generate them.
We should probably have a way to give a set of unicity constraints for each structure (id is one of them).
💡 Idea
Generating structures being tied to one another in a many-to-many or one-to-many relationship in fast-check is not trivial. While feasible it requires our users to come up with advanced and complex options. The two tickets below are asking for it:
As the case is pretty general, we should probably come up with a built-in utility hiding all this complexity and able to generate a simple database content based on a provided schema. The helpers for many-to-many and many-to-one initiated by @gruhn sounds like great ideas to start to think of it.
Disclaimer: while the issue has been opened, there is no certainty that there will be a built-in helpers for that purpose, but at least we can start thinking of it: api, implem...
The text was updated successfully, but these errors were encountered: