cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:
Trying to work out why this isn't returning all the rows of data from the mock. Have I messed up the session instantiation?
use v5.36; use DBI; use DBD::Mock; use Data::Dumper; my $session = DBD::Mock::Session->new('testing' => ( { statement => 'SELECT * FROM bar', results => [ ['one', 'two'], ['three', 'four'] ], } )); my $dbh = DBI->connect('dbi:Mock:', '', '') or die $DBI::errstr; $dbh->{mock_session} = $session; my $data = $dbh->selectall_arrayref("SELECT * FROM bar"); say Dumper({ DATA => $data });
Output:
$VAR1 = { 'DATA' => [ [ 'three', 'four' ] ] };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anyone familiar with DBD:Mock?
by cLive ;-) (Prior) on Feb 07, 2025 at 18:19 UTC | |
|
Re: Anyone familiar with DBD:Mock?
by InfiniteSilence (Curate) on Feb 09, 2025 at 05:41 UTC | |
by cavac (Prior) on Feb 17, 2025 at 12:57 UTC |