X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;h=f63f067b9eae5080e529e063aacc191cb63b7438;hb=05697a49866d989b22944492ebe7e38c4ddc4da2;hp=293363d59dd4ec58fb7ca9ee5c45367b3cb9fcfb;hpb=89869c75ac532068518bfc72e33468014bb68e43;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 293363d..f63f067 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -1298,6 +1298,40 @@ that Microsoft doesn't deliver native client libraries for. (e.g. Linux) The limit dialect can also be set at connect time by specifying a C key in the final hash as shown above. +=head2 Working with PostgreSQL array types + +If your SQL::Abstract version (>= 1.50) supports it, you can assign to +PostgreSQL array values by passing array references in the C<\%columns> +(C<\%vals>) hashref of the L and +L family of methods: + + $resultset->create({ + numbers => [1, 2, 3] + }); + + $row->update( + { + numbers => [1, 2, 3] + }, + { + day => '2008-11-24' + } + ); + +In conditions (eg. C<\%cond> in the L family of +methods) you cannot directly use array references (since this is interpreted as +a list of values to be Ced), but you can use the following syntax to force +passing them as bind values: + + $resultset->search( + { + numbers => \[ '= ?', [1, 2, 3] ] + } + ); + +See L and L for more explanation. + =head1 BOOTSTRAPPING/MIGRATING =head2 Easy migration from class-based to schema-based setup