[CDBI] Storing integer arrays

Aaron Trevena aaron.trevena at gmail.com
Tue Mar 20 12:40:50 GMT 2012


On 20 March 2012 09:25, Bill Moseley <moseley at hank.org> wrote:
> I have a column in Postgress:
>
>    list_of_integers    integer[]  NOT NUL,
>
> $foo->list_of_integers( \@ids );
> $foo->update;
>
> Is there a way to store this in Class::DBI?
>
> DBIx::ContextualFetch complains:  die "Cannot call execute with a reference
> ($_)\n"
>

I think I got something working like that but without using array
datatypes in the DB, if you're able to change the db schema you could
look at nicking code from inside
https://metacpan.org/module/Class::PINT to handle arrays nicely

I did a lot of messing around with CDBI back in the day and that was
one of my experiments (the module and I even got a namecheck in
Advance Perl  2nd edition, although I gave up on that avenue and moved
to DBIx::Class not long after)

regards,

A.

-- 
Aaron J Trevena, BSc Hons
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Consulting



More information about the ClassDBI mailing list