- InflateColumn::DateTime support for MSSQL via DBD::Sybase
- Millisecond precision support for MSSQL datetimes for
InflateColumn::DateTime
+ - Oracle-specific hierarchical query syntax support:
+ CONNECT BY (NOCYCLE) / START WOTH / ORDER SIBLINGS BY
- Support connecting using $ENV{DBI_DSN} and $ENV{DBI_DRIVER}
- current_source_alias method on ResultSet objects to
determine the alias to use in programatically assembled
croak "LIMIT 0 Does Not Compute" if $rest[0] == 0;
# and anyway, SQL::Abstract::Limit will cause a barf if we don't first
- my $sql = '';
- ($sql, @{$self->{where_bind}}) = $self->SUPER::select(
+ my ($sql, @bind) = $self->SUPER::select(
$table, $self->_recurse_fields($fields), $where, $rs_attrs, @rest
);
+ push @{$self->{where_bind}}, @bind;
# this *must* be called, otherwise extra binds will remain in the sql-maker
- my @bind = $self->_assemble_binds;
+ my @all_bind = $self->_assemble_binds;
- return wantarray ? ($sql, @bind) : $sql;
+ return wantarray ? ($sql, @all_bind) : $sql;
}
sub _assemble_binds {
use base qw( DBIx::Class::SQLAHacks );
use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/;
-#
-# TODO:
-# - Review by experienced DBIC/SQL:A developers :-)
-# - Problem with count and connect_by look the TODO in t/73oracle.t
-#
-
sub new {
my $self = shift;
my %opts = (ref $_[0] eq 'HASH') ? %{$_[0]} : @_;
}
-sub _emulate_limit {
- my ( $self, $syntax, $sql, $rs_attrs, $rows, $offset ) = @_;
+sub _parse_rs_attrs {
+ my $self = shift;
+ my ($rs_attrs) = @_;
my ($cb_sql, @cb_bind) = $self->_connect_by($rs_attrs);
- $sql .= $cb_sql;
- $self->{oracle_connect_by_bind} = \@cb_bind;
+ push @{$self->{oracle_connect_by_bind}}, @cb_bind;
+
+ my $sql = $self->SUPER::_parse_rs_attrs(@_);
- return $self->SUPER::_emulate_limit($syntax, $sql, $rs_attrs, $rows, $offset);
+ return "$cb_sql $sql";
}
sub _connect_by {