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

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

has 'column_order' => (is => 'ro', required => 1);

method execute {
  return unless my ($result) = (my $stream = DBIx::Data::Stream::STH->new(
    sth => $self->_new_active_sth, column_order => $self->column_order,
  ))->next;
  if ($stream->next) {
    carp "Query returned more than one row - did you want a stream command?";
  }
  return $result;
}

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

__PACKAGE__->meta->make_immutable;

1;

