Henrik Tougaard wrote on 07 December 2004 10:59
> Martyn J. Pearce skrev:
> > On Fri, Dec 03, 2004 at 11:25:53AM +0000, Tim Bunce wrote:
> ...
> >> The simplest fix is to standardize one set of driver DSN attribute
> >> names so that at least the host, port, and database (schema) can
> >> be specified in a portable way.
> > 
> > Is that really the simplest?  It occurs that the responses on this
> > thread, and in my experience, many people are comfortable & familiar
> > with the use of a hash (/ref) for this purpose.
> 
> Maybe the number of responses on this thread come from people who
> have this itch to scratch. I have heard Tim Bunce (DBI, DBD::Oracle
> etc) and Jonathan Leffler (DBD::Informix) raise 'Beware, thing are
> much more complex than you think' warnings.
> 
> I (DBD::Ingres) have'nt pitched in as Jonathan voiced my concerns
> quite precisely, saying:
>  Beware - DBMS are more different than anyone would like.
>  That's why DBI has the scheme it does have - it is flexible
>  but not easily codified.

I just looked at the DBD::Informix docs. According to them Informix takes a
connections string like:
"dbi:Informix:$database" where $database is constructed like this:

    dbase               # 'Local' database
    //machine1/dbase    # Database on remote machine
    [EMAIL PROTECTED]       # Database on (remote) server (as defined in
sqlhosts)
    @server1            # Connection to (remote) server but no database
    /some/where/dbase   # Connect to local SE database

DBD::Ingres does something similar. DBD::Oracle appears to be closer to
Sybase/MySQl:
"dbi:Oracle:host=myhost.com;sid=ORCL"

It doesn't seem like a stretch of the imagination to see the common fields
"host" and "db" embedded in all three. 

Clearly any DBD driver that can connect to providers on a different host
will have to in some way allow the user to specify which host that is. The
fact that in some particular RDDBMS's culture this isnt called the "host"
and that "port" is for some reason unnecessary is IMO a bit irrelevent. The
fact still remains that the generic "Host" slot could be used for this
purpose quite easily, as could the "DB" slot. Those parameter that make no
sense could either be ignored, or somehow usefully overloaded.

This would enable the establishment of a baseline set of connection details
that all DBD drivers should know how to more or less deal with. At bare
minimum this would mean one less trivial piece of knowledge to remember when
working with multiple providers.

> Ingres, like Informix and (I think) Oracle, does'nt have the concept
> of 'host' or 'port', using other ways of adressing remote databases.
> 
> It seems to me that you are trying to force an extension onto the DBI
> based on what a small number of RDBMSs accept. The people who 
> want this seem to use only a few DBDs - perhaps it could be added to
those?

Coming up with common set of parameters that most DB's are going to require
and then providing standardized names for them would seem to be useful in
general. So far I havent seen anyone provide something that a given driver
Has To Have that doesn't fit into the proposal. (Ie, Host,DB,Port). Which
_mandatory_ parameter does Informix need that can't be shoehorned into one
of those?

Regards,
yves



Reply via email to