Brethren and Sistern,

I find myself in a design quandry, and seek enlightenment...

I've built a database-abstraction-layer module for handling a particular industry-specific data type (bibliographic MARC records). This abstraction layer, of course, uses DBI under the hood.

I've built a few different modules that the abstraction layer would use to connect to different back-ends (MySQL, Postgres, flat files,...). These use DBD.

This is all so that an application can just say "save this horribly complicated binary data thingy" without worrying about it. It works really well.

Right now, I'm hard-coding into the abstraction layer which particular back-end interface to use. Eventually I'll have that pulled from a config file of some sort.

I've got a bazillion tests - abstraction layer and back-end modules.

But here's my question (finally!): Is there some standard way figuring out (at "make" time? Before then?) which back-end the user needs/wants? (eg: if they have both Postgres and MySQL installed, but only have rights to use one or the other).

The second part of this question is for me as a developer - I've got all of the various databases/data stores running, and want to have the "make / make test" run against all of them. Again, right now I manually change (in the abstraction layer) which backend gets used, wrap the unused back-end tests in skip blocks, and then re-run the make. Is there a better way? How would you do it?

Any help you could give would be... well... helpful. :-)

Update:Thanks, all, for your thoughts and your reasoning - it is much appreciated!

-- WARNING: You are logged into reality as root.

In reply to Module configuration for user vs. developer by bibliophile

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.