On Tue, Nov 30, 2004 at 08:53:51PM +0000, Tim Bunce wrote:

> I don't get it. Can someone give me some small but real examples
> of the problem that's being solved here?

The one that I've hit - specifying port and host, Pg vs Mysql (and SQlite):

  if ($dbspec->{driver} eq 'DBI:Pg') {
    # Aaargh. Why aren't these things standarised?
    $dsn = "DBI:Pg:host=$dbspec->{domain}";
    # Aargh. W.T.F. is this case sensitivity here? It fails to connect unless
    # the name is all lowercase (as is stored within the non-case preserving
    # pg DB)
    $dsn .= lc ";dbname=$dbspec->{db_name}" if length $dbspec->{db_name};
    $dsn .= ";port=$dbspec->{port}" if defined $dbspec->{port};
  } else {
    $dsn .= ":port=$dbspec->{port}" if defined $dbspec->{port};
  }

Nicholas Clark

Reply via email to