select by id support
[dbsrgits/DBIx-Data-Store-old.git] / lib / DBIx / Data / Store / Command / Row.pm
1 package DBIx::Data::Store::Command::Row;
2
3 use Moose;
4 use Carp qw(carp);
5 use Method::Signatures::Simple;
6
7 has 'column_order' => (is => 'ro', required => 1);
8
9 method execute {
10   return unless my ($result) = (my $stream = DBIx::Data::Stream::STH->new(
11     sth => $self->_new_active_sth, column_order => $self->column_order,
12   ))->next;
13   if ($stream->next) {
14     carp "Query returned more than one row - did you want a stream command?";
15   }
16   return $result;
17 }
18
19 with 'DBIx::Data::Store::Command';
20
21 __PACKAGE__->meta->make_immutable;
22
23 1;
24