Re: [CDBI] Storing integer arrays

Aaron Trevena <[email protected]> Tue, 20 Mar 2012 12:40:50 +0000
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <CAJWQ4V1NvCZCj_Eq9jHskFy_ZHDaCKzkVRrjf_7KNogs5P_43g@mail.gmail.com>
On 20 March 2012 09:25, Bill Moseley <[email protected]> wrote:
> I have a column in Postgress:
>
> =A0=A0 list_of_integers =A0 =A0integer[] =A0NOT NUL,
>
> $foo->list_of_integers( \@ids );
> $foo->update;
>
> Is there a way to store this in Class::DBI?
>
> DBIx::ContextualFetch complains: =A0die "Cannot call execute with a refer=
ence
> ($_)\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