in reply to DBD::Mock and DBD-specific attributes

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
  • Comment on Re: DBD::Mock and DBD-specific attributes

Replies are listed 'Best First'.
Re^2: DBD::Mock and DBD-specific attributes
by dragonchild (Archbishop) on Aug 17, 2004 at 02:09 UTC
    I would much prefer subclasses of DBD::Mock for specific DBD's that would work in addition to the base DBD::Mock. The idea I would like to see is DBD-specific attributes to be handled by a mock of the specific DBD. You wouldn't have to use them, but you could, if you wanted to.

    Ideally, these subclasses would be in the DBD-Mock distribution, but would be supported by people who are expert in the specific DBD. For example, ideally, tbunce would support DBD::Mock::Oracle (or someone with a similar level of knowledge).

    I would be willing to come up with a basic implementation for mysql and Oracle, as those are the RDBMSes that I work with.

    Thoughts?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested