pg: Adventures in writing a new postgresql client

This commit is contained in:
Yorhel 2025-02-02 14:36:54 +01:00
parent 0d19ccdc1b
commit b242176071
7 changed files with 132 additions and 4 deletions

17
t/pgconnect.t Normal file
View file

@ -0,0 +1,17 @@
use v5.36;
use Test::More;
plan skip_all => $@ if !eval { require FU::PG; } && $@ =~ /Unable to load libpq/;
plan skip_all => 'Please set FU_TEST_DB to a PostgreSQL connection string to run these tests' if !$ENV{FU_TEST_DB};
ok !eval { FU::PG->connect("invalid") };
ok FU::PG::lib_version() > 100000;
my $conn = FU::PG->connect($ENV{FU_TEST_DB});
is ref $conn, 'FU::PG::conn';
ok $conn->server_version() > 100000;
is $conn->lib_version(), FU::PG::lib_version();
done_testing;