1 package DBIx::Class::Storage::DBI::mysql;
7 DBIx::Class::Storage::DBI::MultiColumnIn
8 DBIx::Class::Storage::DBI::AmbiguousGlob
9 DBIx::Class::Storage::DBI
13 __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::MySQL');
15 sub with_deferred_fk_checks {
16 my ($self, $sub) = @_;
18 $self->_do_query('SET FOREIGN_KEY_CHECKS = 0');
20 $self->_do_query('SET FOREIGN_KEY_CHECKS = 1');
23 sub _dbh_last_insert_id {
24 my ($self, $dbh, $source, $col) = @_;
25 $dbh->{mysql_insertid};
33 my ($self, $name) = @_;
35 $self->dbh->do("SAVEPOINT $name");
39 my ($self, $name) = @_;
41 $self->dbh->do("RELEASE SAVEPOINT $name");
45 my ($self, $name) = @_;
47 $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
51 my $status = shift->dbh->selectrow_hashref('show slave status');
52 return ($status->{Slave_IO_Running} eq 'Yes') && ($status->{Slave_SQL_Running} eq 'Yes');
55 sub lag_behind_master {
56 return shift->dbh->selectrow_hashref('show slave status')->{Seconds_Behind_Master};
59 # MySql can not do subquery update/deletes, only way is slow per-row operations.
60 # This assumes you have set proper transaction isolation and use innodb.
61 sub _subq_update_delete {
62 return shift->_per_row_update_delete (@_);
69 DBIx::Class::Storage::DBI::mysql - Storage::DBI class implementing MySQL specifics
73 Storage::DBI autodetects the underlying MySQL database, and re-blesses the
74 C<$storage> object into this class.
76 my $schema = MyDb::Schema->connect( $dsn, $user, $pass );
80 This class implements MySQL specific bits of L<DBIx::Class::Storage::DBI>.
84 See L<DBIx::Class/CONTRIBUTORS>
88 You may distribute this code under the same terms as Perl itself.