1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::Retrieve;
5 use warnings FATAL => 'all';
10 die "No args to retrieve" unless @_ > 0;
12 my @cols = $self->primary_columns;
15 if (ref $_[0] eq 'HASH') {
16 $query = { %{$_[0]} };
20 @{$query}{@cols} = @_;
26 $query = $self->_build_query($query);
32 my $query = ref $_[0] eq 'HASH' ? shift : {@_};
34 $query = $self->_build_query($query);
35 $self->next::method($query);
40 # Build a query hash. Defaults to a no-op; ColumnCase overrides.
43 my ($self, $query) = @_;
48 sub retrieve_from_sql {
49 my ($class, $cond, @rest) = @_;
51 $cond =~ s/^\s*WHERE//i;
53 if( $cond =~ s/\bLIMIT (\d+)\s*$//i ) {
54 push @rest, { rows => $1 };
57 return $class->search_literal($cond, @rest);
62 my $obj = $class->resultset_instance->new_result(@_);
68 sub retrieve_all { shift->search }
69 sub count_all { shift->count }
71 sub maximum_value_of {
72 my($class, $col) = @_;
73 return $class->resultset_instance->get_column($col)->max;
76 sub minimum_value_of {
77 my($class, $col) = @_;
78 return $class->resultset_instance->get_column($col)->min;