While I can recommend Class::DBI::Loader, I can only discourage people from using Class::DBI::Loader::Relationship, which I consider underdocumented and over-hyped. It is/was nice and convincing for Simons live demonstration of how to create a web frontend for a database in under 20 lines of code, but using english as a configuration language for your relationships is really error prone. The error messages or diagnostics (not) output by cdbi:l:r don't help either, and unless you have taken a long look at the source code, it's not easy to modify the examples to suit your actual situation. A more formal syntax would help here and remove the heavy dependency on a good and judicous choice of words made by the program author while still preserving the wanted clarity.

The module relies on the very simple-minded yet totally undocumented assumption that all phrases will be of the form single-noun verb (a|many) noun - once you glean this from the source code, you can start using it, but the time is better invested in some less magic method of setting things up.

Adding to the situation is, that the module is not maintained anymore, and if I stepped up as maintainer of it, I would mainly depreciate the use of the module and replace it by something with a more formal syntax:

brewery 1:n beer # "a brewery produces many beers" beer m:n(handpump) pub # "a pub has beers on handpumps"

In reply to Re^2: Class::DBI -- does it get any easier? by Corion
in thread Class::DBI -- does it get any easier? by geektron

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.