Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 61117
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: davidp [...] preshweb.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Supporting database as an alias for dbname in DSN
The documentation for DBI recommends that DBD::* modules should understand the parameter database= in a DSN, but DBD::SQLite requires dbname=. Quoting from DBI's docs: It is recommended that drivers support the ODBC style, shown in the last example above. It is also recommended that that they support the three common names 'host', 'port', and 'database' (plus 'db' as an alias for database). This simplifies automatic construction of basic DSNs: "dbi:$driver:database=$db;host=$host;port=$port". Drivers should aim to 'do something reasonable' when given a DSN in this form [...] DBD::Pg also expects dbname, but recognises database (and db) also - it would be great if DBD::SQLite would do the same. I'd be happy to provide a patch if requested, although I expect it'd be trivial to implement - the question is more whether you consider it a good idea.
Implemented in the trunk. It's a good idea that fixes an overlooked compat issue. Thanks. On Mon Sep 06 12:15:53 2010, BIGPRESH wrote: Show quoted text
> The documentation for DBI recommends that DBD::* modules should > understand the parameter > database= in a DSN, but DBD::SQLite requires dbname=. > > Quoting from DBI's docs: > > It is recommended that drivers support the ODBC style, shown in > the > last example above. It is also recommended that that they support > the > three common names 'host', 'port', and 'database' (plus 'db' as an > alias for database). This simplifies automatic construction of > basic > DSNs: "dbi:$driver:database=$db;host=$host;port=$port". Drivers > should aim to 'do something reasonable' when given a DSN in this > form > [...] > > DBD::Pg also expects dbname, but recognises database (and db) also - > it would be great if > DBD::SQLite would do the same. > > I'd be happy to provide a patch if requested, although I expect it'd > be trivial to > implement - the question is more whether you consider it a good idea.
DBD::SQLite 1.32_01 with this fix is out. Thanks. On 2010-9-16 Thu 03:31:23, ISHIGAKI wrote: Show quoted text
> Implemented in the trunk. It's a good idea that fixes an overlooked > compat issue. Thanks. > > On Mon Sep 06 12:15:53 2010, BIGPRESH wrote:
> > The documentation for DBI recommends that DBD::* modules should > > understand the parameter > > database= in a DSN, but DBD::SQLite requires dbname=. > > > > Quoting from DBI's docs: > > > > It is recommended that drivers support the ODBC style, shown in > > the > > last example above. It is also recommended that that they
support Show quoted text
> > the > > three common names 'host', 'port', and 'database' (plus 'db' as
an Show quoted text
> > alias for database). This simplifies automatic construction of > > basic > > DSNs: "dbi:$driver:database=$db;host=$host;port=$port". Drivers > > should aim to 'do something reasonable' when given a DSN in this > > form > > [...] > > > > DBD::Pg also expects dbname, but recognises database (and db) also - > > it would be great if > > DBD::SQLite would do the same. > > > > I'd be happy to provide a patch if requested, although I expect it'd > > be trivial to > > implement - the question is more whether you consider it a good
idea. Show quoted text
> >