Each has led to at least an hour of lost time while I scratch my head at my seemingly flawless code failing on a simple, harmless operation.

The time is only lost if you don't learn anything from it. One thing to learn is that there are fewer "simple, harmless" operations than you might want to believe.

Seriously, one of the big "problems" with DBI is that it abstracts away a lot of messy behavior in the underlying database APIs. That problem is also a major feature, but it tempts people into thinking that they don't have to understand what's going on under the covers. That's a recipe for trouble.

If you're going to be doing any serious database work through DBI, you must understand the underlying vendor API. It also helps to have a firm grip on how DBI is abstracting that API. Without this, you risk getting surprised by things like errors that you think should be caught at prepare() time not being caught until execute() (because the underlying database doesn't support prepared queries, but DBI is simulating them for the sake of generality).

Thinking of this as a reactive "where do I go for help once I've realized I'm off in the weeds" problem is tempting. The trick is to do the up-front work so that you know where the weeds are before you find yourself in them.


In reply to Re: Proposed WTF Database by dws
in thread Proposed WTF Database by jbeninger

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.