1 package DBIx::Data::Store::Command::Insert::LastInsertId;
4 use Method::Signatures::Simple;
6 has 'id_column' => (is => 'ro', required => 1);
8 has 'insert_call_command' => (is => 'ro', required => 1);
10 has '_last_insert_id_command' => (is => 'ro', lazy_build => 1);
12 has 'raw_store' => (is => 'ro', required => 1);
14 method _build__last_insert_id_command {
15 $self->raw_store->new_closure_command(sub {
16 +{ $self->id_column => shift->last_insert_id((undef) x 4) }
21 $self->insert_call_command->execute;
22 return $self->_last_insert_id_command->execute;
25 __PACKAGE__->meta->make_immutable;