On Sun Sep 05 15:41:19 2010, steve@blighty.com wrote:
Show quoted text> Version 0.06
>
> A configuration entry such as this...
>
> plugins:
> Database:
> driver: 'Pg'
> database: 'keydancer'
> host: 'localhost'
>
> ... will create this dsn: "dbi:Pg:database=keydancer:host=localhost".
>
> It should create "dbi:Pg:dbname=keydancer;host=localhost".
Well, according to the DBI documentation:
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
So, using 'database' rather than dbname is in general correct; looking
at DBD::Pg's code, it will support that (even though it does not appear
to be documented):
## Allow "db" and "database" as synonyms for "dbname"
$dbname =~ s/\b(?:db|database)\s*=/dbname=/;
You're correct that _get_connection() should should use semicolons
instead of colons to separate parameters though; colons should be used
only for the initial "dbi:$driver:" part; any remaining param=value
pairs should indeed be separated with semi-colons.
Thanks for catching that - I'll get a new version released soon!
I'll close this ticket as soon as the new version is released.
Cheers
Dave P