On Monday, 14 April 2025 at 11:45:19 UTC, Lars Johansson wrote:
I would be very obliged if anyone can advise a way to create the complete BOM tree.

I would:
- Order by parent ID when selecting from the parent-child table
- Use chunkBy() to group the children per-parent
- Then use map() + assocArray() to turn it into an AA. Depending on how your SQL library works it might be important to copy the children to a new dynamic array here.

That will give you an AA that can be used to recursively walk through the BOM with decent enough performance.
  • Performant BOM explosion Lars Johansson via Digitalmars-d-learn
    • Re: Performant BOM explosion Rene Zwanenburg via Digitalmars-d-learn

Reply via email to