1 package DBIx::Class::Storage::DBI::mysql;
6 use base qw/DBIx::Class::Storage::DBI/;
8 # __PACKAGE__->load_components(qw/PK::Auto/);
10 sub _dbh_last_insert_id {
11 my ($self, $dbh, $source, $col) = @_;
12 $dbh->{mysql_insertid};
20 my ($self, $name) = @_;
22 $self->dbh->do("SAVEPOINT $name");
26 my ($self, $name) = @_;
28 $self->dbh->do("RELEASE SAVEPOINT $name");
32 my ($self, $name) = @_;
34 $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
38 my $status = shift->dbh->selectrow_hashref('show slave status');
39 return ($status->{Slave_IO_Running} eq 'Yes') && ($status->{Slave_SQL_Running} eq 'Yes');
42 sub lag_behind_master {
43 return shift->dbh->selectrow_hashref('show slave status')->{Seconds_Behind_Master};
50 DBIx::Class::Storage::DBI::mysql - Automatic primary key class for MySQL
54 # In your table classes
55 __PACKAGE__->load_components(qw/PK::Auto Core/);
56 __PACKAGE__->set_primary_key('id');
60 This class implements autoincrements for MySQL.
64 Matt S. Trout <mst@shadowcatsystems.co.uk>
68 You may distribute this code under the same terms as Perl itself.