...It seems like you want basically the same thing TO_JSON does...

Well ultimately the goal is to turn the result into JSON data. After I have obtained the raw data structure I need to jsonify it so I the client app can receive it.

...couple helpers...

Could you give some links so I can have a look what kind of helpers you are referring to?

...in conjunction with a JSON View in web apps...

Are these JSON Views defined in the database? I basically decided to start using ORM so I keep all the logic inside the app and there would be no need to do anything in the database to keep it as simple as possible. E.g. Let's say I have a user table that contains a relation to user groups and another relation to permissions, then what you are suggesting, I would need to write different views for each type of output (>=4 views)? What I am looking for is so that I don't have to do that, pseudo code for each variant (outputting raw Perl array or hash/JSON) are:

users->relation->groups, user->relation->groups, users->relation->permissions and user->relation->permissions (And if possible even using a filter:) user->relation->permissions->(name EQ 'Can add photo')
That said however I may be looking at this the wrong way. Maybe JSON Views are the 'preferred' way to do it? In that case I would definitively like to know more about it. So in the mean while maybe you can also provide some links (Perl modules?) that deal with that topic?

...flattening to serializing...

I find those terms always confusing. I basically just want to get only the table column names and the data it contains and turn that into JSON.

...so I can't try today...

No worries, things don't have to be solved in one day. Any help is appreciated.


In reply to Re^6: DBIx::Class::ResultSet disired hash output including related items by Veltro
in thread DBIx::Class::ResultSet desired hash output including related items by Veltro

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.