On Thu, Jun 13, 2002 at 04:16:20PM -0700, Jeff Zucker wrote:
> On Thu, 13 Jun 2002, Tim Bunce wrote:
> >
> >Don't forget that all driver-private attribute and functions should
> >start with the driver prefix. So backend_pid should be called pg_backend_pid
> 
> 1. Just to double check, is this correct?
> 
>     $dbh->func(  $some_flags
>               ,  { $NO_PREFIX_attr_name => 3 }

The arguments to a driver-private method are entirely up to you
since they don't occupy a shared namespace. However, you should
probably avoid names that start with uppercase letters since they
may cause confusion if the DBI has (or gets) an attribute with the
same name. In general using the driver prefix is safest.

>               ,  $PREFIX_function_name
>               );
> 
>     $dbh->{ $PREFIX_attr_name }; # use sparingly
> 
>     $dbh = DBI->connect(
>         "dbi:...$NO_PREFIX_attr",...,{$PREFIX_attr}
>      );

Not sure what the first part of that DSN is saying.
Anything that comes after the second colon in a DSN is private to
the driver.  If you want to allow attributes to be specified there
then it would be most consistent to use the same name as they'd
have elsewhere, ie include the prefix.

> Or would it be cleaner to name even the truly private $NO_PREFIX 
> attributes with the prefix as well?

I'm not sure what you're saying here.

> 2. Can we add sql_ as a prefix.  It could be used for SQL::Statement 
> related settings that might get set from a variety of DBDs.

Sure. I've added it to the list in DBI.pm.

Tim.


Reply via email to