DBD-BigQuery
view release on metacpan or search on metacpan
t/26execute_array.t view on Meta::CPAN
use DBI;
my $dbh = DBI->connect('dbi:BigQuery:project=p;dataset=d', '', '');
my $sth = $dbh->prepare('INSERT INTO t (id, data) VALUES (?, ?)');
my @col1 = (100, 200, 300);
my @col2 = ('x', 'y', 'z');
$sth->bind_param_array(1, \@col1);
$sth->bind_param_array(2, \@col2);
my $tuples = $sth->execute_array({ ArrayTupleStatus => [] });
is($tuples, 3, 'execute_array processed 3 tuples');
ok($sth, 'Statement handle active after batch execution');
ok($dbh->ping(), 'Connection alive after batch execution');
t/end-to-end/01-live-connection.t view on Meta::CPAN
}
plan tests => 3;
$ENV{GOOGLE_APPLICATION_CREDENTIALS} = $creds if $creds && -f $creds;
my $dbh = DBI->connect("dbi:BigQuery:project=$project_id;dataset=$dataset_id", '', '', { RaiseError => 1 });
ok($dbh, 'Connected to live Cloud BigQuery dataset');
ok($dbh->ping(), 'Live ping succeeded');
my $sth = $dbh->prepare('SELECT 1 AS alive');
$sth->execute();
my $row = $sth->fetchrow_arrayref();
is($row->[0], 1, 'Fetched live SELECT 1 result');
( run in 3.420 seconds using v1.01-cache-2.11-cpan-14f38c9f855 )