Commit | Line | Data |
65b76960 |
1 | package DBIx::Data::Store::Command::Row; |
2 | |
3 | use Moose; |
4 | use Carp qw(carp); |
5 | use Method::Signatures::Simple; |
6 | |
3347c67e |
7 | has 'column_order' => (is => 'ro', required => 1); |
8 | |
65b76960 |
9 | method 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 | |
19 | with 'DBIx::Data::Store::Command'; |
20 | |
21 | __PACKAGE__->meta->make_immutable; |
22 | |
23 | 1; |
24 | |