1 package DBIx::Class::Storage::DBI::mysql;
6 use base qw/DBIx::Class::Storage::DBI/;
8 # __PACKAGE__->load_components(qw/PK::Auto/);
10 sub with_deferred_fk_checks {
11 my ($self, $sub) = @_;
13 $self->dbh->do('SET foreign_key_checks=0');
15 $self->dbh->do('SET foreign_key_checks=1');
18 sub _dbh_last_insert_id {
19 my ($self, $dbh, $source, $col) = @_;
20 $dbh->{mysql_insertid};
28 my ($self, $name) = @_;
30 $self->dbh->do("SAVEPOINT $name");
34 my ($self, $name) = @_;
36 $self->dbh->do("RELEASE SAVEPOINT $name");
40 my ($self, $name) = @_;
42 $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
46 my $status = shift->dbh->selectrow_hashref('show slave status');
47 return ($status->{Slave_IO_Running} eq 'Yes') && ($status->{Slave_SQL_Running} eq 'Yes');
50 sub lag_behind_master {
51 return shift->dbh->selectrow_hashref('show slave status')->{Seconds_Behind_Master};
58 DBIx::Class::Storage::DBI::mysql - Automatic primary key class for MySQL
62 # In your table classes
63 __PACKAGE__->load_components(qw/PK::Auto Core/);
64 __PACKAGE__->set_primary_key('id');
68 This class implements autoincrements for MySQL.
72 Matt S. Trout <mst@shadowcatsystems.co.uk>
76 You may distribute this code under the same terms as Perl itself.