Thanks for your reply - this really looks very promisising.

For my current needs however I may not be able to use it as I am supposed to use only those CPAN-modules that can be found in the ubuntu-repositories.

But be it as it may - is there an easy way in DBIx::Class to create a row belonging to another resultset based on a given resultset that would copy over all shared attributes?

In pseudo-code something like:

my $rs1 = $schema->resultset("table1"); my $rs2 = $schema->resultset("table2"); my $o1 = $rs1->find({ id => $id }); my $o2 = $rs2->create_copy($o1); # does something like this exist?
As a related question I know I can get plain hashes from a resultset with DBIx::Class::ResultClass::HashRefInflator but only when I use it as a setting on the resultset-class.

But how would I convert a row that I have already retrieved, i.e. something like

my $o = $rs1->find({ id => $id }); my $hash_ref = $o->as_hashref; # does this exist?
Many thanks!

In reply to Re^2: data historization with DBIx::Class by morgon
in thread data historization with DBIx::Class by morgon

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.