BingoX
view release on metacpan or search on metacpan
lib/BingoX/Carbon.pm view on Meta::CPAN
}
}
$sql .= "$field " . uc($type) . ' (' . join(', ', @IN_sql) . ')';
push(@bindings, @IN_bindings);
} elsif (substr(lc($type), -7) eq 'between') { # 'BETWEEN' or 'NOT BETWEEN'
return $self->error_handler("no bindings passed to format_conditions for type ($type)")
unless (@values);
$sql .= "$field " . uc($type) . ' ? AND ?';
push(@bindings, @values[0,1]);
} else { # LIST of conditions
splice (@valuelist, $x+1, 0, @$value); # appending will push to next iterations
}
} elsif ($value =~ /^\/(.+?)\/$/) { # regex
$sql .= "$field ~ ?";
push(@bindings, $1);
} elsif ($value =~ /^(\d+?)-(\d+?)$/) { # date or numeric range
$sql .= "($field > ? AND $field < ?)";
push(@bindings, $1, $2);
} elsif ($value eq '&&') { # AND
$sql .= ' AND ';
} elsif ($value eq '||') { # OR
( run in 0.849 second using v1.01-cache-2.11-cpan-96521ef73a4 )