| 1 | |||
| 2 | package DBIx::Romani::Driver::sqlite::IdGenerator; | ||
| 3 | use base qw(DBIx::Romani::IdGenerator); | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | |||
| 7 | sub is_before_insert | ||
| 8 | { | ||
| 9 | return 0; | ||
| 10 | } | ||
| 11 | |||
| 12 | sub is_after_insert | ||
| 13 | { | ||
| 14 | return 1; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub get_id_method | ||
| 18 | { | ||
| 19 | return "auto_increment"; | ||
| 20 | } | ||
| 21 | |||
| 22 | sub get_id | ||
| 23 | { | ||
| 24 | my $self = shift; | ||
| 25 | return $self->get_conn()->get_dbh()->func( 'last_insert_rowid' ); | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 |