Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Dear Monks:

Class::DBI and DBIx::Class both seem to be very nice modules for accessing relational databases in an object-oriented way. Both modules look rather similar and it is hard for me to decide which one I should use. It would be great, if you could advise me on this decision---generally I would prefer the more robust and stable solution.

So far, I tried to use Class::DBI and DBD::DB2 on ActivePerl. This works for fine for SELECTs; however, insert() does not work for some reason (Can't locate object method "insert"). When I use DBD::CSV, insert works. Alternatively, I could use perl on cygwin (but I have to find out how to compile DBD::DB2 there). Hints on this problem would also be appreciated!

Thank you,

Update: Thanks for all these helpful comments! To summarize, the options are the following:
  • Class::DBI provides a straightforward interface; however, its features are somewhat limited.
  • DBIx::Class provides more general interfaces that allow greater flexibility and complexity; this comes at the cost of being slightly more difficult to get started. Furthermore, this module has an active development community
  • Rose::DB::Object provides a third alternative. It supports only a limited number of databases (DBD modules are not sufficient; e.g., DB2 is not supported).

In reply to Class::DBI vs. DBIx::Class by hrr

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (3)
    As of 2018-04-22 12:52 GMT
    Find Nodes?
      Voting Booth?