dragonchild,

I have made modifications to DBD::Mock to support the handling of arbitrary attributes that DBI does not seem to handle (it seems DBI handles anything with the following prefixes 'private_', 'dbi_' and 'dbd_'). Since I do not yet have official upload capabilities for DBD::Mock on CPAN yet, you will have to msg me and I can sent it to you.

However, I am not sure that this is the best way to handle this though. I have a few ideas, and I would like to hear your opinion (and jZed's) of them.

  1. Leave it how it is, allowing arbitrary attributes to be stored and retrieved.
  2. When storing attributes like 'mysql_insert_id', you will be required to prefix it with 'mock_' ('mock_mysql_insert_id'). When you fetch them however, they can be called without the prefix ('mysql_insert_id').
  3. Allow the assignment of a callback function to handle such attributes. This would be called when either DBD::Mock of DBI could not handle it.
And option 1 and 2 do not need to exclude option 3, they could likely co-exists together in some way. Personally I am leaning towards option 2 and maybe option 3 combined with it.

Any thoughts?

-stvn

In reply to Re: DBD::Mock and DBD-specific attributes by stvn
in thread DBD::Mock and DBD-specific attributes by dragonchild

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.