[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-21 Thread BigBaaadBob
I went ahead and coded something up, inspired by Massimo's Preorder Traversal example. I wouldn't be offended if people suggest how to make it better/faster, perhaps by combining stuff in the Link function into one query instead of many. # Demonstrate closure tables. Deletion of nodes is left a

[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-21 Thread Val K
Why do you have to use this crutches (despite they are genius)? Now, even Sqlite3 supports 'with recursive' queries. And what do you mean under BOM and large tree? If we are talking about BOM of real (physical) object like a car or even an aircraft carrier, I think it is not large tree only

[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-21 Thread BigBaaadBob
I'm just trying to find a good solid way of doing the BOM pattern using the DAL, and pretty much all of the decent articles I've found say the Closure Table method is the best trade-off, especially for large-ish and deep-ish BOM structures. But, I'm not dogmatic. How would you code up a versio

[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-21 Thread Dave S
On Wednesday, November 21, 2018 at 10:33:13 AM UTC-8, BigBaaadBob wrote: > > I'm just trying to find a good solid way of doing the BOM pattern using > the DAL, and pretty much all of the decent articles I've found say the > Closure Table method is the best trade-off, especially for large-ish an

[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-21 Thread BigBaaadBob
The use case is manufacturing. Large complicated manufacturing with special requirements. And SAP need not apply... :-) On Wednesday, November 21, 2018 at 1:26:56 PM UTC-8, Dave S wrote: > > > > On Wednesday, November 21, 2018 at 10:33:13 AM UTC-8, BigBaaadBob wrote: >> >> I'm just trying to find

[web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-24 Thread Val K
running example: # fake table in which result of recursive select will be temporary stored # id-values will be inherited from parent_child table db.define_table('entry_collector', Field('child', 'integer'), Field('xpath', 'json'), # array of ids, xpath[0] == root, xpath[-1] ==

Re: [web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-26 Thread Ben Duncan
What database are you using ? In our e-file system, we have something similar with court cases, but we use db functions to do the heavy lifting for use, since in postgres they can be called with a select directly ... *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court El

Re: [web2py] Re: Hierarchy (BOM) using closure table with triggers in DAL?

2018-11-26 Thread Val K
It is sqlite3 example and it also uses db function... I do not quite understand what confuses you On Monday, November 26, 2018 at 3:47:29 PM UTC+3, Ben Duncan wrote: > > What database are you using ? > > In our e-file system, we have something similar with court cases, but we > use db functions