The first thing I thought when I saw this was "deja vu!" ;) You should really have a section near the top of the POD explaining what distinguishes your module from other similar ones. I just did a quick search and found DBIx::Librarian, SQL::Catalog, and SQL::Library on CPAN. There are most certainly others. The differences among all of them aren't obvious to me as I've never used any modules like this, and I think a section of the POD addressing this would help potential users who are shopping for a module.

I do think I like your interface at first glance. It's fairly concise. But I really don't like the syntax needed for:

# select $$what$$ from offices' $sql->offices(what => "`address`, `address2`, `city`, `state`");
I think having the module do all the ugly quoting instead would be a little cleaner:
# select $$what$$ from offices $sql->offices(what => [ qw/address address2 city state/ ]);
I also don't see any mention of mixing DBI placeholders with your $$foo$$ placeholders. Can I have a query like this:
# select $$what$$ from offices where office_id=? $sql->offices(what => [qw/name city/])->do($office_id);
From a skim of the code, it looks as though this is possible -- perhaps an example in the POD is in order, since losing DBI placeholder functionality would be scary.

And speaking of placeholders, have you given thought to the quoting of your $$foo$$ placeholders? If they quoted, I could use your module to do named placeholders as a complete replacement for DBI's positional placeholders (native RDBMS placeholder performance aside). Maybe you could even use different delimiters to specify different quoting rules (like the backtick-quoted column names above, single-quoted data like DBI placeholders, and non-quoted things like LIMIT clauses). I don't want to give your small module featuritis, but it's some food for thought.

$POD =~ s/quries/queries/

blokhead


In reply to Re: RFC: DBIx::Library by blokhead
in thread RFC: DBIx::Library by eric256

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.