pg: Support array types
That wasn't quite as painful as I had anticipated. \o/
This commit is contained in:
parent
b6517cf05a
commit
7d71e446d0
4 changed files with 323 additions and 48 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue