On Thu, Dec 16, 2004 at 10:39:17PM +0100, Jochen Wiedmann wrote: > Jeff Zucker wrote: > > >>After the "dbi:AnyData:" everything should be in "name=value;" format. > >>So "dbi:AnyData:format=XML;table=Test;file=test.xml" > > Btw, Tim, how about the following suggestion: The discussion on the DSN > format is, IMO, mainly caused by the fact, that the DBI doesn't support > parsing the DSN.
Not quite true. See DBI->parse_dsn($dsn) > Would it be possible, that a driver requests, that he doesn't receive > the DSN as a string, but as a hash ref? IMO, this would terminate such > discussions once and forever. (Of course, the driver should still be > free to parse the DSN for itself.) Nothing will terminate such discussions once and forever :) Anyway, connect() *already does* allow attributes to be passed as a hash ref! It's called the \%attr parameter. Drivers could, and probably should, allow any attribute that can be specified in the driver-dsn string to also be specified via \%attr. I've no plans to change the parameters to DBI->connect. But... The DBI->parse_dsn() method could be extended to also return a hash parsed from the driver-dsn - assuming the driver-dsn uses "n=v;" format. A DBI->compose_dsn() method could be added to compose a DBI DSN string from a bunch of parameters. If someone wants to send me a patch to implement those changes (with docs and tests) then I'd be interested. Best to write the docs first though so we can agree on the (devils in the) details. Tim.