Re: Question on FetchHashKeyName

[email protected]
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
On Tue Feb 28, 2017 at 07:37:17PM +0100, Jonas B. Nielsen wrote:
> 
> - Would it be possible to have FetchHashKeyName preserve case? so if
> a database was using camelCase this would be preserved.

A quick test seems to produce what you are looking for with the default
setting of "NAME":

    #!/usr/bin/env perl
    use strict;
    use warnings;
    use Data::Dumper;
    use DBI;

    my $db  = DBI->connect('dbi:SQLite:db=:memory:');
    my $sth = $db->prepare(q{SELECT 1 AS CamelCase});
    $sth->execute;

    print Dumper( $sth->fetchrow_hashref );

    # Output is:
    # $VAR1 = {
    #          'CamelCase' => 1
    #        };

What kind of behaviour were you expecting?

Mark
-- 
Mark Lawrence
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAli12gEACgkQnNgnvsIyXKs+xgCdF52KGBLcYm5SW0vSQj3zTuw5
xm4AnR6rRb/FCZx7TOUmwRojQeQPOoAl
=uiBr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.