[CDBI] Storing integer arrays

Bill Moseley moseley at hank.org
Tue Mar 20 15:48:57 GMT 2012

On Tue, Mar 20, 2012 at 7:19 PM, paul trader <fliptop at igolinux.com> wrote:

> On Tue, 20 Mar 2012 at 16:25, Bill Moseley opined:
> BM:I have a column in Postgress:
> BM:
> BM:   list_of_integers    integer[]  NOT NUL,
> BM:
> BM:$foo->list_of_integers( \@ids );
> BM:$foo->update;
> BM:
> BM:Is there a way to store this in Class::DBI?
> hi bill - what version of pgsql are you using?


Arrays work fine with DBD::Pg.  I use them with DBIx::Class.  But with
Class::DBI DBIx::ContextualFetch has:

sub _disallow_references {
	my $self = shift;
	foreach (@_) {
		next unless ref $_;
		next if overload::Method($_, q{""});
		next if overload::Method($_, q{0+});
		die "Cannot call execute with a reference ($_)\n";

which is called before calling $sth->execute to check bind parameters.

I was curious if I was just missing something and there was a easy way to
use integer[] with CDBI.


Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digitalcraftsmen.net/pipermail/classdbi/attachments/20120320/21d1c003/attachment.html>

More information about the ClassDBI mailing list