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