I'm afraid I can't provide any useful comment on your DBIx::Class specific questions. However if arbitrary SQL is as important to you as the ORM part I would like to suggest perhaps a cursory look at SQL::DB. (Disclaimer: I am the author of that module).

The following is a real example from one of my own projects:

my @nodes = $self->fetch( select => [ $nodes->id, $nodes->path, coalesce( $nodest->nav, $nodest->title, $nodes->nav, $nodes->title)->as('nav'), ], from => [$nodes,$nodes2], left_join => $nodest, on => ($nodest->transof == $nodes->id) & ($nodest->lang == $self->lang), where => $nodes2->lft->between($nodes->lft, $nodes->rht) & ($nodes2->id == $id), order_by => $nodes->lft, );

The objects returned from this query are blessed into a dynamically created class that contains only 'id', 'path' and 'nav' methods. The advantage of this style of query is that you can write anything you like, and retrieve exactly (and only) the information you want from the database. The disadvantage (compared with ORM-style DBIx::Class) is that you have to construct for each query with exactly what you want. Ie: no automatic joining of tables, and no auto-inflation.

Unfortunately I have to follow with the caveat that SQL::DB is still under development and suffers from lack of documentation and exposure outside my own projects. However (and here the true motivation for this comment) I would certainly appreciate feedback and knowing how SQL::DB is/isn't suitable for your task.


In reply to [OT] Re: Migrating to DBIx::Class by mlawren
in thread Migrating to DBIx::Class by DBX

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.