Hi Konrad. "And really The detail records will never be accessed outside the context of the master record. They don't need any indexing, or independent lookup."
Then I think you've made the right decision, in VizReader for instance, each user subscribes to some feeds in a private context, ie knowing which users subscribe to any given feed is not a priority, this looks like this: (class +User +Entity) (rel uname (+Need +Key +String)) (rel pwd (+Need +String)) (rel feeds (+List +Ref +Link) NIL (+Feed)) .. "Also As master records don;t relate to each other I'm a little confused as to how I hand the rest of the database together. Do I just start it and add objects to it Or do I need to build a top level List of master objects and set this as the first object in the database." No you just go ahead and create objects: (new (db: +Article) '(+Article) 'htmlUrl HtmlUrl) 2012/2/12 José Romero <[email protected]>: > On Sun, 12 Feb 2012 16:16:26 +1100 > Konrad Zielinski <[email protected]> wrote: > >> Hi, >> >> I'm trying to work out the proper way to setup a master detail >> relationship in a Picolisp database. >> >> I have a master record with child records where each child record is a >> string and a number. Different master records do not at all care about >> each others details. >> And really The detail records will never be accessed outside the >> context of the master record. They don't need any indexing, or >> independent lookup. >> >> so is this the way you would do this? >> >> (class +Child +Entity) >> (rel description (+Key +String)) >> (rel rank (+Number)) >> >> (class +Master +Entity) >> (rel children (+List +Link) ord (+Child)) >> >> Also As master records don;t relate to each other I'm a little >> confused as to how I hand the rest of the database together. >> Do I just start it and add objects to it Or do I need to build a top >> level List of master objects and set this as the first object >> in the database. >> >> regards >> >> Konrad >> > > Hmm, isn't this type of relationship covered by the +Ord and +Pos > classes in the example app included in picolisp's sources? > > # @app/er.l > (class +Ord +Entity) > (rel nr (+Need +Key +Number)) # Order Number > [...] > (rel pos (+List +Joint) ord (+Pos)) # Positions > > (class +Pos +Entity) > (rel ord (+Dep +Joint) # Order > (itm) > pos (+Ord) ) > [...] > > Orders (masters) are keyed by the order number and +Pos "Order Items" > are linked to the order by a +Joint +List. > > Cheers, > José > -- > UNSUBSCRIBE: mailto:[email protected]?subjectUnsubscribe -- UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
