handler => '_where_field_PRIOR',
};
- $self->SUPER::new (\%opts);
+ $self->next::method(\%opts);
}
sub _assemble_binds {
my $self = shift;
- return map { @{ (delete $self->{"${_}_bind"}) || [] } } (qw/select from where oracle_connect_by group having order/);
+ return map { @{ (delete $self->{"${_}_bind"}) || [] } } (qw/pre_select select from where oracle_connect_by group having order limit/);
}
my ($cb_sql, @cb_bind) = $self->_connect_by($rs_attrs);
push @{$self->{oracle_connect_by_bind}}, @cb_bind;
- my $sql = $self->SUPER::_parse_rs_attrs(@_);
+ my $sql = $self->next::method(@_);
return "$cb_sql $sql";
}
my ( @sql, @bind );
for my $c ( $self->_order_by_chunks($arg) ) {
- $self->_SWITCH_refkind(
- $c,
- {
- SCALAR => sub { push @sql, $c },
- ARRAYREF => sub { push @sql, shift @$c; push @bind, @$c },
- }
- );
+ if (ref $c) {
+ push @sql, shift @$c;
+ push @bind, @$c;
+ }
+ else {
+ push @sql, $c;
+ }
}
my $sql =
my $f = $options->{returning};
- my ($f_list, @f_names) = $self->_SWITCH_refkind($f, {
- ARRAYREF => sub {
- (join ', ', map { $self->_quote($_) } @$f),
- @$f
- },
- SCALAR => sub {
- $self->_quote($f),
- $f,
- },
- SCALARREF => sub {
- $$f,
- $$f,
- },
- });
+ my ($f_list, @f_names) = do {
+ if (! ref $f) {
+ (
+ $self->_quote($f),
+ $f,
+ )
+ }
+ elsif (ref $f eq 'ARRAY') {
+ (
+ (join ', ', map { $self->_quote($_) } @$f),
+ @$f,
+ )
+ }
+ elsif (ref $f eq 'SCALAR') {
+ (
+ $$f,
+ $$f,
+ )
+ }
+ else {
+ $self->throw_exception("Unsupported INSERT RETURNING option $f");
+ }
+ };
my $rc_ref = $options->{returning_container}
or $self->throw_exception('No returning container supplied for IR values');