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 ]

btilly (5037)

  (email not shown publicly)

Journal of btilly (5037)

Thursday June 07, 2007
06:22 PM

What does DBD::Pg not liked named parameters?

[ #33466 ]

At $work I'm getting a few basic tools set up. Since we use PostgreSQL, I'm using DBD::Pg. With DBD::Oracle I grew to like some of the more flexible ways of entering parameters, so I look for that in DBD::Pg. I find that there are three options.

1. The DBI standard ?. If I was happy with that, I wouldn't be reading this documentation.

2. They allow positional parameters with $1, $2, $3. Given that this is inside of Perl, I'm going to constantly be wondering whether I'm accidentally interpolating in variables. Better than ? but I don't really like the syntax. The visual disambiguation from variable interpolation was a reason to prefer DBD::Oracle's :1, :2 and so on.

3. They support full named parameters. :foo. :bar. Yay! I like it! But they go on to say, While this syntax is supported by DBD::Pg, its use is highly discouraged.

Huh? Does anyone know why they discourage the cleanest and most flexible solution? Personally whenever I get the chance to work by name rather than by position, I jump at the opportunity. But I'm somewhat reluctant to use a feature that the software authors don't want me to use without knowing the reason for that dislike...

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.