Util: Add to_bool() and use it for JSON, Pg & query encoding
To improve interop with legacy modules.
This commit is contained in:
parent
06e2f950fe
commit
c7a3415485
10 changed files with 141 additions and 37 deletions
|
|
@ -92,12 +92,12 @@ subtest '$st prepare & exec', sub {
|
|||
|
||||
# Interleaved
|
||||
{
|
||||
my $a = $conn->q('SELECT 1 as a');
|
||||
my $b = $conn->q('SELECT 2 as b');
|
||||
is_deeply $a->columns, [ { oid => 23, name => 'a' } ];
|
||||
is_deeply $b->columns, [ { oid => 23, name => 'b' } ];
|
||||
is $a->val, 1;
|
||||
is $b->val, 2;
|
||||
my $x = $conn->q('SELECT 1 as a');
|
||||
my $y = $conn->q('SELECT 2 as b');
|
||||
is_deeply $x->columns, [ { oid => 23, name => 'a' } ];
|
||||
is_deeply $y->columns, [ { oid => 23, name => 'b' } ];
|
||||
is $x->val, 1;
|
||||
is $y->val, 2;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -347,9 +347,9 @@ subtest 'txn', sub {
|
|||
}
|
||||
|
||||
{
|
||||
my $a = [1,2];
|
||||
my $st = $conn->q('SELECT $1::int[]', $a)->text(0);
|
||||
$a->[1] = 3;
|
||||
my $x = [1,2];
|
||||
my $st = $conn->q('SELECT $1::int[]', $x)->text(0);
|
||||
$x->[1] = 3;
|
||||
is_deeply $st->val, [1,3], 'not deep copy';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue