This sounds like a classic many-to-many situation, and so it seems that it would be helpful for you to develop an intermediate representation for the data in your files. That is, instead of going from a file directly to DBD, write modules which convert or adapt the file data to a common intermediate form. Then write another module which will store the results via DBD. That would make it easier if later you want to add additional output formats, like HTML or XML or JSON, or if you just want to process it differently.

One idea for the intermediate representation is just an array of hashes. This assumes that your text files contain a list of "records" which each record having "fields". Just write one converter for each file format that normalizes the data to this canonical structure.

Also, are you thinking of treating each file as a DBD database that would be accessed through the DBI API? That's the only time you'd need to create a new DBD driver, and I'm not sure that's really what you want to do.


In reply to Re: Generic front end with back-end drivers? by pc88mxer
in thread Generic front end with back-end drivers? by toma

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.