Re: Making DBD::Pg to return Postgres arrays as Perl arrays
[email protected] (Adam Sjøgren) Thu, 07 May 2015 22:04:47 +0200
| Newsgroups | gmane.comp.lang.perl.modules.dbix-class,gmane.comp.db.postgresql.dbdpg,gmane.comp.lang.perl.modules.dbi.general |
|---|---|
| Organization | koldfront - analysis & revolution, Copenhagen, Denmark |
| Message-ID | <[email protected]> |
Tim writes:
>> $schema->resultset('Vehicle')->create({ entrylist=>[
>> [ 'a', '2015-05-07', 'info', 'adsj' ],
>> [ 'b', '2015-05-07', 'more', 'adsj' ],
>> ] });
> Take a look at https://metacpan.org/pod/PGObject::Type::Composite
Yeah, Chris pointed me to that as well.
I just thought that when DBD::Pg handles "simple" arrays, handling
arrays of tuples wouldn't be much further a step.
On the write side, the above is turned into {{a,...},{b,...}}, so the
only problem is that the inner {},{} should be (),() instead.
On the read side, there might be more complications.
I haven't looked into DBD::Pg, I was just curious if I was overlooking
existing functionality.
Thanks!
Adam
--
"it will turn into pointer equality or something Adam Sjøgren
ghastly like that" [email protected]
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]