pg: Support array types

That wasn't quite as painful as I had anticipated. \o/
This commit is contained in:
Yorhel 2025-02-09 16:17:58 +01:00
parent b6517cf05a
commit 7d71e446d0
4 changed files with 323 additions and 48 deletions

View file

@ -15,6 +15,9 @@ like $@, qr/Unable to use type/;
$txn->exec("CREATE TYPE fupg_test_enum AS ENUM('a', 'b', 'ccccccccccccccccccc')");
is $txn->q("SELECT 'a'::fupg_test_enum")->val, 'a';
is $txn->q('SELECT $1::fupg_test_enum', 'ccccccccccccccccccc')->val, 'ccccccccccccccccccc';
is_deeply $txn->q("SELECT '{a,b,null}'::fupg_test_enum[]")->val, ['a','b',undef];
is $txn->q('SELECT $1::fupg_test_enum[]', ['a','b',undef])->text_results->val, '{a,b,NULL}';
}
done_testing;