[Dbix-class] Fixing my relationships to get working queries

Peter Rabbitson rabbit+dbic at rabbit.us
Mon Jan 19 18:29:31 GMT 2015


The question as you wrote it is good, I just need to clarify some extra 
things before I answer it:

On 01/19/2015 07:23 PM, John Stoffel wrote:
>
>
>     > ../bin/dbic-test2.pl carpenter
>     SELECT me.name_id, me.full_name, me.last_name, me.first_name, me.comments, account.account_id, account.account_number, account.boxfolder_id, account.name_id, account.url, account.comments, account.volume, account.box, account.folder, account.range FROM (SELECT me.name_id, me.full_name, me.last_name, me.first_name, me.comments FROM names me WHERE ( full_name REGEXP ? ) ORDER BY full_name ASC LIMIT ?) me LEFT JOIN account account ON account.name_id = me.name_id WHERE ( full_name REGEXP ? ) ORDER BY full_name ASC: '[[:<:]]carpenter[[:>:]]', '10', '[[:<:]]carpenter[[:>:]]'
>     Full Name: Carpenter, John  (7333)
>       account_id=3176 boxfolder_id=423  URL: fol01 V=35  F=fol01  R=
>       account_id=3177 boxfolder_id=423  URL: fol01 V=35  F=fol01  R=
>       account_id=3178 boxfolder_id=423  URL: fol01 V=35  F=fol01  R=
>     Full Name: Carpenter, John Jr.  (7334)
>       account_id=3179 boxfolder_id=106  URL: b08f01 V=16  F=1  R=6003-6128
>       account_id=3180 boxfolder_id=112  URL: b08f07 V=16  F=7  R=6780-6806
>       account_id=3181 boxfolder_id=122  URL: b09f02 V=17  F=2  R=6999-7125
>       account_id=3182 boxfolder_id=122  URL: b09f02 V=17  F=2  R=6999-7125

You show your script as executing one query (there is only one line 
above), yet further down you say:

> And I'm completely confused why there are multiple SELECTs since the
> whole idea of prefetch was to just pull in the info ahead of time

Um... yes - which one is it? Did yoiu get a single SELECT statement or 
multiple?

>
> Do you want me to send you more details on the Schema I have?
>

Nope, what we have so far is plenty.




More information about the DBIx-Class mailing list