Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

izut (6269)

  (email not shown publicly)
AOL IM: igorsutton (Add Buddy, Send Message)

Perl programmer and enthusiast.

Journal of izut (6269)

Sunday January 13, 2008
07:14 PM

DBIx::Placeholder::Named and DBIx::Dictionary

[ #35383 ]

I updated last week DBIx::Placeholder::Named to version 0.07, which is more compliant with DBI - accepting PlaceholderSuffix and PlaceholderPrefix keys - after I presented it on meeting. I can say that I was surprised that nobody yelled with some module doing the exact same thing...

And continuing the things-I-would-like-to-see-on-DBI I wrote DBIx::Dictionary, which tries to add, in the same clean way DBIx::Placeholder::Named does with named placeholders, query dictionary functionality.

It integrates well with DBIx::Placeholder::Named, and currently only supports Config::General configuration files. I'm planning to add support for some SQL compliant configuration file.

I'd like to hear from you what you think about those modules!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • But I won't be using it because named placeholders like that is already built in to DBD::Pg.

    However if I was trying to write portable code that needed to handle lots of SQL, I definitely would use that.
    • Hi btilly!

      Actually, the DBIx::Placeholder::Named module was conceived in part of rewriting some functionalities of Tao::DBI, for example inheriting properly DBI, and one of its goals is provide named placeholders to database drivers that doesn't support it (like MySQL and SQLite, for instance).

      The cool part about this project is if you want (or need) to deploy your application in some database other than postgresql, you can possibly do that without much effort.

      Using DBIx::Dictionary as top layer for DBIx an
      Igor Sutton
  • With respect to DBIx::Dictionary, the concept of phrasebooks as introduced by this article: The Phrasebook Design Pattern [], the Class::Phrasebook [], and the newer (and more actively maintained) Data::Phrasebook [] can be a wealthy source of layout for the set of named queries.
    • The point in DBIx::Dictionary is have a real DBI subclass that support the phrasebook design pattern, and make it can even be subclassed by other DBIx::* classes like DBIx::Simple.

      I wanted to write it with the same thinking I had in mind when wrote DBIx::Placeholder::Named, which was inspired by yours Tao::DBI: small and straight to the point.

      Hope this clarifies the idea behind those modules :-)
      Igor Sutton