DSNs (was: DBI v2 - The Plan and How You Can Help)

DSNs (was: DBI v2 - The Plan and How You Can Help)

am 16.08.2005 17:48:21 von Tim.Bunce

On Sun, Jul 10, 2005 at 06:43:39PM +0200, Juerd wrote:
> Jeffrey W. Baker skribis 2005-07-09 11:27 (-0700):
> > > Oh drat - not the DBI connection string discussion again!

Relax. DSN strings are not going away.

> > There are certainly database-specific things to be worked around. An
> > improvement to the current DSN scheme would be a URI, as discussed in
> > the past. The leading dbi: on every DSN is redundant, so a URI might
> > look like this:
> > driver://user:pass@host:port/instance
>
> I think URIs are the right way to go, and one of the very few things PHP
> (though be it with PEAR) did right.
>
> http://pear.php.net/manual/en/package.database.db.intro-dsn. php

And they possibly copied the idea from JDBC.

Note that the DBIs DSNs are already URIs in as much as the format is

:

(with the exception of no formal encoding/escaping rules, but they
wouldn't make much difference in practice.)

> It would be fun if we could just steal that design and build on top of
> it, for compatibility, but also because other people have already
> thought about it and proven that it works.

It's not exactly complicated.

DSNs for DBI v2 are very likely to be more formally specified as URIs.

Tim.