On Mon, 29 Nov 2004, Darren Duncan wrote:
> On Mon, 29 Nov 2004, Hans Schou wrote:
> > But making dbi:// a default prefix will probably restrict the use of
> > DBURL to only DBI. It is not realistic to think that MySQL and
> > PostgreSQL would implement such a naming scheme, where as the original
> > idea might be accepted.
>
> Considering that it sounds like you want to embed your DBURL
> implementation into the DBI interface spec itself, then why is
> DBI-specificity a problem?
I wanted the syntax to be short. An example:
$dbh = DBI->connect("dburl=dbi://localhost/pgsql");
$dbh = DBI->connect("dburl=pgsql://localhost");
I can see no reason for having dbi:// as DBI would know that a URL
will always follow a dburl=
If the implementation in DBI would have the syntax:
$dbh = DBI->connect("dbi://localhost/pgsql");
I could see a reason. But this will only consider DBI, not PostgreSQL,
MySQL or Oracle.
(Oracle will probably stick to tnsnames.ora anyway)
> side of the "://". Essentially, take Hans' format as it is, but interpret
> "protocol" to mean "the name of the DBD module to use".
In that way the protocol for PostgreSQL should be 'pg'.
$dbh = DBI->connect("dburl=pg://localhost");
or the socket version:
$dbh = DBI->connect("dburl=pg://");
Nice and short.
> Another issue to consider is that of encoding the individual parts
> of the URI, in case, for example, the password contains a ":" or "/"
> etc, or if there are differing case-sensitivity issues. Perhaps the
> format of "delimited SQL identifiers" could provide an example to
> follow.
Password could have any character except '@'. The rule for http is
that these characters ':' and '/' should be represented as %2E and so
on.
/hans
--
Hamletsgade 4 - 201, DK-2200 K�benhavn N, Phone: +45 3582 9079
Schou Industries ApS http://schou.dk/ CVR: 26 13 44 39
--------------------------------------------------------------
De sultne b�rn i Afrika t�nker ogs� p� dig
-- �Husk mit navn� (anonym)