package DBIx::Data::Store::Command::Row;

use Moose;
use Carp qw(carp);
use Method::Signatures::Simple;

method execute {
  my $sth = $self->_new_active_sth;
  my @row = $sth->fetchrow_array;
  my @nextrow = $sth->fetchrow_array if @row;
  if(@row && @nextrow) {
    carp "Query returned more than one row - did you want a stream command?";
  }
  # Need to call finish() to work round broken DBDs
  $sth->finish();
  return \@row;
}

with 'DBIx::Data::Store::Command';

__PACKAGE__->meta->make_immutable;

1;

