Arango-DB
view release on metacpan or search on metacpan
lib/Arango/DB/Cursor.pm view on Meta::CPAN
C<Arango::DB::Cursor> answers to the following methods:
=head1 METHODS
=over 4
=item C<next>
Returns the next results. On the first call, returns the results
obtained from the first query request. Subsequent requests will try
to gather more hits if they exists, and the query id is still alive.
=item C<has_more>
Returns a boolean stating if there are more results to be fetched.
=item C<finish>
Deletes the cursor in the server and destroys all the object details.
=back
t/01-database.t view on Meta::CPAN
# -*- cperl -*-
use Arango::DB;
use Test2::V0;
use Test2::Tools::Exception qw/dies lives/;
do "./t/helper.pl";
skip_all "No ArangoDB environment variables for testing. See README" unless valid_env_vars();
skip_all "Can't reach ArangoDB Server" unless server_alive();
my $arango = Arango::DB->new( );
clean_test_environment($arango);
## -- version
my $version = $arango->version;
is $version->{server} => 'arango';
$version = $arango->version( details => 1 );
ok (exists($version->{details}));
t/02-collection.t view on Meta::CPAN
use Arango::DB;
use Test2::V0;
use Test2::Tools::Exception qw/dies lives/;
do "./t/helper.pl";
skip_all "No ArangoDB environment variables for testing. See README" unless valid_env_vars();
skip_all "Can't reach ArangoDB Server" unless server_alive();
my $arango = Arango::DB->new( );
clean_test_environment($arango);
my $collections = $arango->list_collections;
is ref($collections), "ARRAY", "Collection list is an array";
my $db = $arango->create_database("tmp_");
my $test_collections = $db->list_collections;
t/03-document.t view on Meta::CPAN
use Arango::DB;
use Test2::V0;
use Test2::Tools::Exception qw/dies lives/;
do "./t/helper.pl";
skip_all "No ArangoDB environment variables for testing. See README" unless valid_env_vars();
skip_all "Can't reach ArangoDB Server" unless server_alive();
my $arango = Arango::DB->new( );
clean_test_environment($arango);
my $db = $arango->create_database("tmp_");
my $collection = $db->create_collection("collection");
$collection->create_document( { Hello => 'World' });
t/04-query.t view on Meta::CPAN
# -*- cperl -*-
use Arango::DB;
use Test2::V0;
use Test2::Tools::Exception qw/dies lives/;
do "./t/helper.pl";
skip_all "No ArangoDB environment variables for testing. See README" unless valid_env_vars();
skip_all "Can't reach ArangoDB Server" unless server_alive();
my $arango = Arango::DB->new( );
clean_test_environment($arango);
my $db = $arango->create_database("tmp_");
my $collection = $db->create_collection("collection");
my $documents = [
{ name => 'Fred Flinstone', gender => 'male' },
t/05-users.t view on Meta::CPAN
# -*- cperl -*-
use Arango::DB;
use Test2::V0;
use Test2::Tools::Exception qw/dies lives/;
do "./t/helper.pl";
skip_all "No ArangoDB environment variables for testing. See README" unless valid_env_vars();
skip_all "Can't reach ArangoDB Server" unless server_alive();
my $arango = Arango::DB->new( );
clean_test_environment($arango);
my $ans = $arango->create_user('tmp_');
is $ans->{user}, "tmp_", "Looks like it was created";
$ans = $arango->delete_user('tmp_');
is $ans->{code}, 202, "Looks like it was deleted";
t/helper.pl view on Meta::CPAN
use HTTP::Tiny;
sub server_alive {
my $port = $ENV{ARANGO_DB_PORT} || 8529;
return HTTP::Tiny->new->get("http://$ENV{ARANGO_DB_HOST}:$port")->{success};
}
sub clean_test_environment {
my $arango = shift;
my @x = grep { $_ eq "tmp_"} @{$arango->list_databases};
if (scalar @x) {
$arango->delete_database("tmp_")
( run in 0.823 second using v1.01-cache-2.11-cpan-df04353d9ac )