Re: Request consideration of DBD::Neo4p registration

2014-02-10 Thread Tim Bunce
On Mon, Feb 10, 2014 at 12:19:05AM -0500, Mark Jensen wrote:
Greetings DBI, I would like to register DBD::Neo4p in DBI with prefix 
 neo_. It provides a DBI wrapper
for a REST interface to the Neo4j db.

Done.

https://metacpan.org/pod/REST::Neo4p

I'd suggest abstracting out the transport interface to allow multiple
transports. Similar to https://metacpan.org/pod/Elasticsearch::Transport

That lets you, and others, implement other transport/connection modules.
I mention this because LWP is not the fastest HTTP interface. There are
several transports for Elasticsearch that are significantly faster.
For example https://metacpan.org/pod/Elasticsearch::Cxn::NetCurl

https://metacpan.org/pod/DBD::Neo4p

Great. And good to have another NoSQL driver too.

Thanks.

Tim.


Re: Request consideration of DBD::Neo4p registration

2014-02-10 Thread Martin J. Evans

On 10/02/14 08:36, Tim Bunce wrote:

On Mon, Feb 10, 2014 at 12:19:05AM -0500, Mark Jensen wrote:

Greetings DBI, I would like to register DBD::Neo4p in DBI with prefix neo_. 
It provides a DBI wrapper
for a REST interface to the Neo4j db.


Done.


https://metacpan.org/pod/REST::Neo4p


I'd suggest abstracting out the transport interface to allow multiple
transports. Similar to https://metacpan.org/pod/Elasticsearch::Transport


++


That lets you, and others, implement other transport/connection modules.
I mention this because LWP is not the fastest HTTP interface. There are
several transports for Elasticsearch that are significantly faster.
For example https://metacpan.org/pod/Elasticsearch::Cxn::NetCurl


We found curl much faster than LWP - see http://www.martin-evans.me.uk/node/117 
for some numbers and a problem I hit (and got around) with POSTing in Curl.
 

https://metacpan.org/pod/DBD::Neo4p


Great. And good to have another NoSQL driver too.

Thanks.

Tim.



Martin


[perl5-dbi/dbi] a32d0b: Register neo_ prexfix for DBD::Neo4p.

2014-02-10 Thread Tim Bunce
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/dbi
  Commit: a32d0b0a6307e427b7c667ec3ee0600fcb93be68
  
https://github.com/perl5-dbi/dbi/commit/a32d0b0a6307e427b7c667ec3ee0600fcb93be68
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M DBI.pm

  Log Message:
  ---
  Register neo_ prexfix for DBD::Neo4p.




Re: DBD::mysql 4.026 released

2014-02-10 Thread H.Merijn Brand
On Fri, 17 Jan 2014 16:16:49 -0500, Patrick Galbraith p...@patg.net
wrote:

 Dear Perl and MySQL community,
 
 I’m pleased to announce the release of DBD::mysql 4.026
 
 In this release:
 
 2014-01-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.026)
 * t/29warnings.t fails on MySQL Server 5.1.something - Reported by RT91202, 
 Gisle Aas. Now is handled depending on version.
 * README.pod misses proper NAME heading - RT90101 - Damyan Ivanov, Debian 
 Perl Group
 * Added fix and test for RT91715 (ability to obtain $dbh-{mysql_use_result} 
 value)
 * Added feature from Jacob Gelbman (cPanel) mysql_skip_secure_auth
 
 Thanks to everyone who contributed!
 
 For more information: http://search.cpan.org/~capttofu/DBD-mysql-4.026
 
 Regards,
 
 Patrick

Does this count as problematic?

Linux 3.11.6-4-desktop [openSUSE 13.1 (Bottle)]  i386 Core(TM) i7-2620M CPU @ 
2.70GHz/2187(4) i686  8032 Mb
mysql  Ver 15.1 Distrib 5.5.33-MariaDB, for Linux (i686) using readline 5.1
This is perl 5, version 18, subversion 2 (v5.18.2) built for i686-linux-64int-ld
DBI-1.631

  cflags(mysql_config ) = -I/usr/include/mysql -fomit-frame-pointer 
-fmessage-length=0 -grecord-gcc-switches -fstack-protector -D_FORTIFY_SOURCE=2 
-funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -DPIC -fPIC 
-fno-strict-aliasing -g -DNDEBUG
  embedded  (mysql_config ) =
  ldflags   (mysql_config ) =
  libs  (mysql_config ) = -L/usr/lib -lmysqlclient -lpthread -lz -lm 
-lssl -lcrypto -ldl
  mysql_config  (guessed  ) = mysql_config
  nocatchstderr (default  ) = 0
  nofoundrows   (default  ) = 0
  ssl   (guessed  ) = 1
  testdb(User's choice) = merijn
  testhost  (default  ) =
  testpassword  (default  ) =
  testport  (default  ) =
  testsocket(default  ) =
  testuser  (guessed  ) = merijn

cc -c  -I/pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld/auto/DBI 
-I/usr/include/mysql -fomit-frame-pointer -fmessage-length=0 
-grecord-gcc-switches -fstack-protector -D_FORTIFY_SOURCE=2 -funwind-tables 
-fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -DPIC -fPIC 
-fno-strict-aliasing -g -DNDEBUG -DDBD_MYSQL_WITH_SSL 
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -fstack-protector 
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   
-DVERSION=\4.026\ -DXS_VERSION=\4.026\ -fPIC 
-I/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE   dbdimp.c
In file included from 
/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE/perl.h:5156:0,
 from 
/pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld/auto/DBI/DBIXS.h:23,
 from dbdimp.h:20,
 from dbdimp.c:18:
dbdimp.c: In function ‘mysql_db_FETCH_attrib’:
dbdimp.c:2585:34: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
   result= sv_2mortal(newSViv((IV) imp_dbh-pmysql));
  ^
/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE/embed.h:554:46: note: in 
definition of macro ‘sv_2mortal’
 #define sv_2mortal(a)  Perl_sv_2mortal(aTHX_ a)
  ^
dbdimp.c:2585:26: note: in expansion of macro ‘newSViv’
   result= sv_2mortal(newSViv((IV) imp_dbh-pmysql));
  ^
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3676:22: warning: assignment from incompatible pointer type [enabled 
by default]
   buffer-is_null= (fbh-is_null);
  ^
In file included from 
/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE/perl.h:5156:0,
 from 
/pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld/auto/DBI/DBIXS.h:23,
 from dbdimp.h:20,
 from dbdimp.c:18:
dbdimp.c: In function ‘mysql_st_FETCH_attrib’:
dbdimp.c:4539:35: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
 retsv= sv_2mortal(newSViv((IV) imp_sth-result));
   ^
/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE/embed.h:554:46: note: in 
definition of macro ‘sv_2mortal’
 #define sv_2mortal(a)  Perl_sv_2mortal(aTHX_ a)
  ^
dbdimp.c:4539:27: note: in expansion of macro ‘newSViv’
 retsv= sv_2mortal(newSViv((IV) imp_sth-result));
   ^
cc -c  -I/pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld/auto/DBI 
-I/usr/include/mysql -fomit-frame-pointer -fmessage-length=0 
-grecord-gcc-switches -fstack-protector -D_FORTIFY_SOURCE=2 -funwind-tables 
-fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -DPIC -fPIC 
-fno-strict-aliasing -g -DNDEBUG -DDBD_MYSQL_WITH_SSL 
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe -fstack-protector 
-I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   
-DVERSION=\4.026\ -DXS_VERSION=\4.026\ -fPIC 
-I/pro/lib/perl5/5.18.2/i686-linux-64int-ld/CORE   mysql.c
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH=/usr/lib 

Re: DBIT prototype - feedback wanted

2014-02-10 Thread H.Merijn Brand
On Sun, 9 Feb 2014 23:18:24 +, Tim Bunce tim.bu...@pobox.com
wrote:

 As you probably know, I've been hacking on a rough DBI::Test prototype
 for a while. My primary goal has been to discover and explore the issues.
 Trying to write only the minimum amount of code to do so.
 
 It's now at the stage where there's something basic working for
 all the key aspects...
 
 Test variant generation
 The interface between the generated test script and the input test module
 Integration with Test::Database
 Fixture provider abstraction
 Fixture abstraction, including auto-teardown on DESTROY
 Support for unique table names so parallel testing works
 
 Please take a moment to read this README file:
 
 https://github.com/perl5-dbi/DBI-Test/blob/master/sandbox/tim/README.pod
 
 Then, ideally, checkout the repo and play with it.
 
 Then, please, give me feedback!
 
 What's good?
 What's bad?

DBI-Test-git/sandbox/tim 517  perl tumbler.pl
String found where operator expected at tumbler.pl line 269, near croak Test 
variant setting key '$dst_key' already exists
(Do you need to predeclare croak?)
syntax error at tumbler.pl line 269, near croak Test variant setting key 
'$dst_key' already exists
Global symbol $dst_key requires explicit package name at tumbler.pl line 271.
Global symbol $src_key requires explicit package name at tumbler.pl line 271.
syntax error at tumbler.pl line 274, near }
Can't use global @_ in my at tumbler.pl line 278, near = @_
syntax error at tumbler.pl line 313, near }
Execution of tumbler.pl aborted due to compilation errors.

 What can be done better?
 What's missing?

a use Carp; statement

 What's are the priorities now?

I think riba and I would agree that there should be a template to copy
for *any* DBD as a strating-kit

USAGE:
  $ cd /your/DBD-xxx
  $ perl -MDBI-Test -we'install_templates()'
  $ perl dbi-test-tumbler.pl
  $ prove -j4 -sr out

Maybe I am too narrow-minded, but I like to work from the results
backward. I find it hard to comment on anything that I do not know
how to use.

 Thanks!
 
 Tim.


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


Re: DBIT prototype - feedback wanted

2014-02-10 Thread Tim Bunce
On Mon, Feb 10, 2014 at 03:21:02PM +0100, H.Merijn Brand wrote:
 
 DBI-Test-git/sandbox/tim 517  perl tumbler.pl
 String found where operator expected at tumbler.pl line 269, near croak 
 Test variant setting key '$dst_key' already exists

Fixed. (I was using an older perl that didn't trip up on that.)

  What's are the priorities now?
 
 I think riba and I would agree that there should be a template to copy
 for *any* DBD as a strating-kit
 
 USAGE:
   $ cd /your/DBD-xxx
   $ perl -MDBI-Test -we'install_templates()'
   $ perl dbi-test-tumbler.pl
   $ prove -j4 -sr out

I think we're not ready for that yet. There are many issues (as noted in
the README) that we should work on to flesh out the prototype first.

Also it looks like you're proposing that DBI-Test 'installs templates'
into a DBD source tree. That doesn't seem like important functionality
to work on just yet. The primary goal of DBIT is to run a set of common
tests against many drivers.

Extra driver-specific tests will be a nice feature but it seems
conterproductive to add that till we're more sure about the various
interfaces those external tests will rely on.

 Maybe I am too narrow-minded, but I like to work from the results
 backward. I find it hard to comment on anything that I do not know
 how to use.

Please try running perl tumbler.pl  prove -r out with the latest
version, then work from the results (the out/ dir) backwards.

I hope how to use it is reasonably clear from the README but please ping
me on irc if you hit any problems.

Tim.


Re: DBIT prototype - feedback wanted

2014-02-10 Thread H.Merijn Brand
On Mon, 10 Feb 2014 21:26:26 +, Tim Bunce tim.bu...@pobox.com
wrote:

 On Mon, Feb 10, 2014 at 03:21:02PM +0100, H.Merijn Brand wrote:
  
  DBI-Test-git/sandbox/tim 517  perl tumbler.pl
  String found where operator expected at tumbler.pl line 269, near croak 
  Test variant setting key '$dst_key' already exists
 
 Fixed. (I was using an older perl that didn't trip up on that.)

5.18.2 is now my working perl on my laptop.
Once I do not encounter new(ish) problems, I'll also install it on my
$work-PC

   What's are the priorities now?
  
  I think riba and I would agree that there should be a template to copy
  for *any* DBD as a strating-kit
  
  USAGE:
$ cd /your/DBD-xxx
$ perl -MDBI-Test -we'install_templates()'
$ perl dbi-test-tumbler.pl
$ prove -j4 -sr out
 
 I think we're not ready for that yet. There are many issues (as noted in
 the README) that we should work on to flesh out the prototype first.
 
 Also it looks like you're proposing that DBI-Test 'installs templates'
 into a DBD source tree. That doesn't seem like important functionality
 to work on just yet. The primary goal of DBIT is to run a set of common
 tests against many drivers.

That is what my goal is too. But once that works, I can start writing
new tests. That is exactly what I did with the previous state.

 Extra driver-specific tests will be a nice feature but it seems
 conterproductive to add that till we're more sure about the various
 interfaces those external tests will rely on.

IMHO that is up to the driver authors. Shit, I'm one of them :/

  Maybe I am too narrow-minded, but I like to work from the results
  backward. I find it hard to comment on anything that I do not know
  how to use.
 
 Please try running perl tumbler.pl  prove -r out with the latest
 version, then work from the results (the out/ dir) backwards.

When time permits, will do.

Where do I run tumbler? in the DBD ?

 I hope how to use it is reasonably clear from the README but please ping
 me on irc if you hit any problems.

I'll start with the README

 Tim.

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


Re: DBIT prototype - feedback wanted

2014-02-10 Thread Tim Bunce
On Mon, Feb 10, 2014 at 10:53:41PM +0100, H.Merijn Brand wrote:
 On Mon, 10 Feb 2014 21:26:26 +, Tim Bunce tim.bu...@pobox.com
 wrote:
 
  Please try running perl tumbler.pl  prove -r out with the latest
  version, then work from the results (the out/ dir) backwards.
 
 When time permits, will do.

Thanks!

 Where do I run tumbler? in the DBD ?

In the directory where tumbler.pl is. I've updated the README to say that.

Tim.


Making DBI (results) more strict

2014-02-10 Thread Max Maischein

Hi all,

I recently discovered the greatness that is Hash::Util::lock_ref_keys , 
when used together with -fetchall_arrayref() like this:


...
my $rows= $sth-fetchall_arrayref( {} };
for( @$rows ) {
lock_ref_leys( $_ );
};
...

This prevents me from accessing hash keys that don't exist. Usually, 
this is inconvenient, but with SQL query results, I (too) often 
encounter different case for the column names, or other inconsistencies. 
Especially when columns are allowed to be NULL, it may take me a while 
to figure out that I'm looking at the wrong key.


I'd like to enable this returning of locked hashes from within DBI, 
preferrably on a per-$dbh-level:


my $dbh= DBI-connect( $dsn, 'scott', 'tiger', { RaiseError = 1, 
StrictResults = 1 });


Alternatively, I'm also open to suggestions on how to best implement 
this feature in a separate module, tentatively named DBI::strict. I've 
thought about doing some AUTOLOAD reflection onto the real $dbh, but I'm 
unsure about how to best approach wrapping arbitrary DBD 
handles/statement handles with my DBI::strict::st without interfering. 
Also, I'd appreciate hints on what subroutine(s) would be the most 
appropriate to enable locking the hashes, as I want to write as little 
new code for such a feature as necessary.


Thanks for reading,
-max


[perl5-dbi/DBI-Test] 46a32c: Automate detection of pure-perl drivers.

2014-02-10 Thread Tim Bunce
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/DBI-Test
  Commit: 46a32cd3de4d3abdb5f1e88b8d2c72149994338f
  
https://github.com/perl5-dbi/DBI-Test/commit/46a32cd3de4d3abdb5f1e88b8d2c72149994338f
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/tumbler.pl

  Log Message:
  ---
  Automate detection of pure-perl drivers.




[perl5-dbi/DBI-Test] 049404: Add cd .../DBI-Test/sandbox/tim; to README

2014-02-10 Thread Tim Bunce
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/DBI-Test
  Commit: 0494042ef519ccb80beeb60f9c78fe7d66928f5f
  
https://github.com/perl5-dbi/DBI-Test/commit/0494042ef519ccb80beeb60f9c78fe7d66928f5f
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/README.pod

  Log Message:
  ---
  Add cd .../DBI-Test/sandbox/tim; to README




[perl5-dbi/DBI-Test] 6eebc8: Use Carp qw(croak). Die if no tests written (eg ba...

2014-02-10 Thread Tim Bunce
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/DBI-Test
  Commit: 6eebc8abfd10116007c173e32062e000317ff9b6
  
https://github.com/perl5-dbi/DBI-Test/commit/6eebc8abfd10116007c173e32062e000317ff9b6
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/tumbler.pl

  Log Message:
  ---
  Use Carp qw(croak). Die if no tests written (eg bad Test:Database config).


  Commit: 35f9a86361a1986d3e3f8dc090406427206cfee9
  
https://github.com/perl5-dbi/DBI-Test/commit/35f9a86361a1986d3e3f8dc090406427206cfee9
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/README.pod

  Log Message:
  ---
  Add prereq details. Add some other notes.


Compare: 
https://github.com/perl5-dbi/DBI-Test/compare/29e8d4177458...35f9a86361a1

[perl5-dbi/DBI-Test] 9f033d: add missing use of Carp

2014-02-10 Thread Jens Rehsack
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/DBI-Test
  Commit: 9f033d519a92b24450e00a5946ecd3ff4984c872
  
https://github.com/perl5-dbi/DBI-Test/commit/9f033d519a92b24450e00a5946ecd3ff4984c872
  Author: Jens Rehsack s...@netbsd.org
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/tumbler.pl

  Log Message:
  ---
  add missing use of Carp


  Commit: 758c7678869cedf2812c5de7f2ecc6a47c93dcbe
  
https://github.com/perl5-dbi/DBI-Test/commit/758c7678869cedf2812c5de7f2ecc6a47c93dcbe
  Author: Jens Rehsack s...@netbsd.org
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/README.pod
M sandbox/tim/tumbler.pl

  Log Message:
  ---
  Merge branch 'master' of github.com:/perl5-dbi/DBI-Test


Compare: 
https://github.com/perl5-dbi/DBI-Test/compare/35f9a86361a1...758c7678869c

[perl5-dbi/DBI-Test] d94cdf: Add note about creating a Test::Database config fi...

2014-02-10 Thread Tim Bunce
  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/DBI-Test
  Commit: d94cdf66b7d4abf7066963a68e403aef9fd8c41c
  
https://github.com/perl5-dbi/DBI-Test/commit/d94cdf66b7d4abf7066963a68e403aef9fd8c41c
  Author: Tim Bunce tim.bu...@pobox.com
  Date:   2014-02-10 (Mon, 10 Feb 2014)

  Changed paths:
M sandbox/tim/README.pod

  Log Message:
  ---
  Add note about creating a Test::Database config file




Re: Making DBI (results) more strict

2014-02-10 Thread H.Merijn Brand
On Mon, 10 Feb 2014 19:57:41 +0100, Max Maischein cor...@corion.net
wrote:

 Hi all,
 
 I recently discovered the greatness that is Hash::Util::lock_ref_keys , 
 when used together with -fetchall_arrayref() like this:
 
  ...
  my $rows= $sth-fetchall_arrayref( {} };
  for( @$rows ) {
  lock_ref_leys( $_ );
k
  };
  ...
 
 This prevents me from accessing hash keys that don't exist. Usually, 
 this is inconvenient, but with SQL query results, I (too) often 
 encounter different case for the column names, or other inconsistencies.

connect with { FetchHashKeyName = NAME_lc }

 Especially when columns are allowed to be NULL, it may take me a while 
 to figure out that I'm looking at the wrong key.
 
 I'd like to enable this returning of locked hashes from within DBI, 
 preferrably on a per-$dbh-level:
 
  my $dbh= DBI-connect( $dsn, 'scott', 'tiger', { RaiseError = 1, 
 StrictResults = 1 });

I can see use in that
On the or hand I'm unlikely to use it.  quite often use

my $dbh = DBI-connect (…);
my $sth = $dbh-prepare (…);
   $sth-execute;
my %rec;
$sth-bind_columns (\@rec{@{$sth-{NAME_lc}}});
while ($sth-fetch) {
$rec{new_field} = function (@rec{qw( key field other_field )});
$csv-print ($ofh, [ \@rec{@wanted} ]);
}

where wanted is a combination of fields from the database (lower case
of course) and added/generated fields

 Alternatively, I'm also open to suggestions on how to best implement 
 this feature in a separate module, tentatively named DBI::strict. I've 
 thought about doing some AUTOLOAD reflection onto the real $dbh, but I'm 
 unsure about how to best approach wrapping arbitrary DBD 
 handles/statement handles with my DBI::strict::st without interfering. 
 Also, I'd appreciate hints on what subroutine(s) would be the most 
 appropriate to enable locking the hashes, as I want to write as little 
 new code for such a feature as necessary.
 
 Thanks for reading,
 -max


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/