Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set handle class to DBI::db #37

Open
Wu-Wu opened this issue Dec 30, 2012 · 0 comments
Open

Unable to set handle class to DBI::db #37

Wu-Wu opened this issue Dec 30, 2012 · 0 comments

Comments

@Wu-Wu
Copy link

Wu-Wu commented Dec 30, 2012

If pointed to use handle_class: 'DBI::db', the plugin tries to require DBI/db.pm module and Dancer raises an exeption because DBI::db package located inside DBI.pm module.

At the moment I dont know how to handle this. May be a hashref of classes and its packages to load will be used. E.g.

$special = {
  'DBI::db' => 'DBI.pm',
  'DBD::Proxy::db' => 'DBD/Proxy.pm',
  ...
};

if (exists $special->{$handle_class}) {
  $package = $special->{$handle_class};
}
else {
  $package = $handle_class;
  $package =~ s{::}{/}g;
  $package .= '.pm';
}

require $package;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant