]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB.pm
allow specifying the database using the DSN
[debbugs.git] / Debbugs / DB.pm
index c16463680d9278a7b7ed24135627bd1799487e07..313bfbb35d70b337ae9e1eca9846dc5026e711eb 100644 (file)
@@ -20,4 +20,14 @@ __PACKAGE__->load_namespaces;
 our $VERSION=2;
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
+
+# override connect to handle just passing a bare service
+sub connect {
+    my ($self,@rem) = @_;
+    if ($rem[0] !~ /:/) {
+       $rem[0] = 'dbi:Pg:service='.$rem[0];
+    }
+    $self->clone->connection(@rem);
+}
+
 1;