Subject: | DBD::Sybase connection parameters |
DBD::Sybase supports a "server" connection parameter. When this is included in the "connections" section in the config.yml file, it is ignored and Dancer::Plugin::Database can't connect to Sybase or MS SQL Server databases. Here is the error:
DBI connect('database=Sample;port=1433','user',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
at /Users/cseaton/opt/perl51802/lib/site_perl/5.18.2/Dancer/Plugin/Database/Core.pm line 258.
The configuration file referenced is part of the FreeTDS requirement for DBD::Sybase on Linux and OS X systems. See: http://www.freetds.org/
I found that adding "server" to the @extra_args array in the _get_connection sub routine allows Dancer::Plugin::Database to connect to my SQL Server instance. Diff attached.
Since I can also include a full dsn in my configuration setting, I'm logging this as Unimportant. That said, it's such a small change I thought I'd make this suggestion.
One final note: there is drift between the version number in the POD and $Dancer::Plugin::Database::Core::VERSION (0.04 v 0.05).
Thanks!
Subject: | DPDC.diff |
--- Core.pm 2013-12-22 13:18:32.000000000 -0800
+++ Core.mod.pm 2014-04-01 13:48:16.000000000 -0700
@@ -216,7 +216,7 @@
$settings->{dbname} = delete $settings->{database};
}
- for (qw(database dbname host port sid)) {
+ for (qw(database dbname host port sid server)) {
if (exists $settings->{$_}) {
push @extra_args, $_ . "=" . $settings->{$_};
}