use DBD::Pg qw(:pg_types);
use Scope::Guard ();
-use Context::Preserve ();
+use Context::Preserve 'preserve_context';
+use namespace::clean;
# Ask for a DBD::Pg with array support
warn __PACKAGE__.": DBD::Pg 2.9.2 or greater is strongly recommended\n"
$self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
});
- return Context::Preserve::preserve_context(sub { $sub->() },
- after => sub { $txn_scope_guard->commit });
+ return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
}
# only used when INSERT ... RETURNING is disabled