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 'raw_store' => (is => 'ro', required => 1);
13 $self->insert_call_command->execute;
14 return { $self->id_column => $self->_get_last_insert_id }
17 method _get_last_insert_id {
18 # this should probably involve some sort of call to the raw
19 # store to get the command object from it, but meh
20 $self->raw_store->connection->run(sub {
21 shift->last_insert_id((undef) x 4)
25 __PACKAGE__->meta->make_immutable;