Your points are quite valid, and by no means am I suggesting that this module would be the end-all to DBI programming.

The thing that I was trying to do with this was (as indicated in the thread noted) to separate out SQL from programming logic as one tries to do with HTML and programming logic. Yes, I know SQL/logic are more closely tied, but I've found that once I've gotten most of the program logic down, I hardly touch the SQL from that point. SQL statements tend to be 'static' (regardless of placeholders), so isolating them once programming is done is not unreasonable.

As for other SQL engines and the idea of lists or sets, all you are giving DBI::Pretty are plain text SQL statements and a DBI handler; as you probably know what you are doing with what database, any problems with SQL statements not carrying over is your own fault; DBI::Pretty isn't trying to recreate a standard DBI. And as long as you can write the SQL to handle sets or lists, there's no reason why this doesn't work with it. You'll still be needing to use placeholders and the like.

I'm not offering DBI::Pretty as a placebo; I don't expect to see a "Use DBI::Pretty or die()" thread on PM anytime soon. But based on the indicated thread, there does seem to be a vested interest in cleaning SQL calls. Tangram is one approach as you've got above, though I've not used it myself; looking over the docs, it's more to rid the SQL-nature of database calls into a more OOP-type of way. Here, I assume that you still want to have SQL around, but not as embedded in the program as is typically done. What I believe DBI::Pretty offers is a way to develop SQL/DBI calls that are not only easier to read, but offer a way to genralize common SQL calls (eg "SELECT $fields FROM..." can be used assume the rest is the same with any number of combinations of $fields), as well as possibly helping to relieve maintainence nightmares. I have no expectations of where this might go; it was mostly built for curiosity's sake (and now I know how to use AUTOLOAD as well, which is a plus).


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

In reply to Re: Re: DBI::Pretty by Masem
in thread DBIx::Pretty (was DBI::Pretty) by Masem

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.