[Dbix-class] RFC: DBIx::Class::JSON

Dami Laurent (PJ) laurent.dami at justice.ge.ch
Thu Sep 14 08:22:36 CEST 2006


> Nilson Santos Figueiredo Junior
> Envoyé : jeudi, 14. septembre 2006 05:36

> Relationships are also dumped.
> So if you've got A which has_many B, you'll get something like:
> 
> A = {
>   A_field1: 'value',
>   A_field2: 'value',
>   // etc
>   relationship: [
>     { B_field1: 'value', B_field2: 'value' },
>     { B_field1: 'value', B_field2: 'value' }
>   ]
> }
>

Well, following all relationships automatically might lead you to 
dump the whole database ! So the programmer needs a way to specify
which relationships should be followed, how deep the recursion will go,
etc, but it's not obvious to design a simple yet powerful API for that.
I tried to do it with methods 'expand', 'autoExpand' in DBIx::DataModel, 
but it needs further work to become more flexible.

Best regards, L. Dami



More information about the Dbix-class mailing list