changed the way args are passed to a storage, should make it easier to use existing...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / mysql.pm
1 package DBIx::Class::Storage::DBI::mysql;
2
3 use strict;
4 use warnings;
5
6 use base qw/DBIx::Class::Storage::DBI/;
7
8 # __PACKAGE__->load_components(qw/PK::Auto/);
9
10 sub _dbh_last_insert_id {
11   my ($self, $dbh, $source, $col) = @_;
12   $dbh->{mysql_insertid};
13 }
14
15 sub sqlt_type {
16   return 'MySQL';
17 }
18
19 sub _svp_begin {
20     my ($self, $name) = @_;
21
22     $self->dbh->do("SAVEPOINT $name");
23 }
24
25 sub _svp_release {
26     my ($self, $name) = @_;
27
28     $self->dbh->do("RELEASE SAVEPOINT $name");
29 }
30
31 sub _svp_rollback {
32     my ($self, $name) = @_;
33
34     $self->dbh->do("ROLLBACK TO SAVEPOINT $name")
35 }
36
37 sub is_replicating {
38     my $self = shift @_;
39 }
40
41 sub lag_behind_master {
42     my $self = shift @_;
43 }
44
45 1;
46
47 =head1 NAME
48
49 DBIx::Class::Storage::DBI::mysql - Automatic primary key class for MySQL
50
51 =head1 SYNOPSIS
52
53   # In your table classes
54   __PACKAGE__->load_components(qw/PK::Auto Core/);
55   __PACKAGE__->set_primary_key('id');
56
57 =head1 DESCRIPTION
58
59 This class implements autoincrements for MySQL.
60
61 =head1 AUTHORS
62
63 Matt S. Trout <mst@shadowcatsystems.co.uk>
64
65 =head1 LICENSE
66
67 You may distribute this code under the same terms as Perl itself.
68
69 =cut