use strict;
use warnings;
+use base qw/DBIx::Class::Storage::DBI::MultiColumnIn/;
+use mro 'c3';
+
use DBD::Pg qw(:pg_types);
-use base qw/DBIx::Class::Storage::DBI/;
+# Ask for a DBD::Pg with array support
+warn "DBD::Pg 2.9.2 or greater is strongly recommended\n"
+ if ($DBD::Pg::VERSION < 2.009002); # pg uses (used?) version::qv()
-# __PACKAGE__->load_components(qw/PK::Auto/);
+sub with_deferred_fk_checks {
+ my ($self, $sub) = @_;
-# Warn about problematic versions of DBD::Pg
-warn "DBD::Pg 1.49 is strongly recommended"
- if ($DBD::Pg::VERSION < 1.49);
+ $self->dbh->do('SET CONSTRAINTS ALL DEFERRED');
+ $sub->();
+}
sub _dbh_last_insert_id {
my ($self, $dbh, $seq) = @_;
my $bind_attributes = {
bytea => { pg_type => DBD::Pg::PG_BYTEA },
+ blob => { pg_type => DBD::Pg::PG_BYTEA },
};
if( defined $bind_attributes->{$data_type} ) {
sub _svp_release {
my ($self, $name) = @_;
- $self->dbh->pg_release($name;)
+ $self->dbh->pg_release($name);
}
sub _svp_rollback {