2nd Pass
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / DBDFile.pm
CommitLineData
7606fd62 1package DBIx::Class::Storage::DBI::DBDFile;
ac50f57b 2
3use strict;
4use base 'DBIx::Class::Storage::DBI';
5use mro 'c3';
7606fd62 6use DBIx::Class::Carp;
ac50f57b 7use namespace::clean;
8
9__PACKAGE__->sql_maker_class('DBIx::Class::SQLMaker::SQLStatement');
10__PACKAGE__->sql_quote_char('"');
7606fd62 11__PACKAGE__->sql_limit_dialect('LimitXY');
ac50f57b 12
13# Unsupported options
14sub _determine_supports_insert_returning { 0 };
15
16# Statement caching currently buggy with either S:S or DBD::AnyData (and/or possibly others)
17# Disable it here and look into fixing it later on
18sub _init {
19 my $self = shift;
20 $self->next::method(@_);
21 $self->disable_sth_caching(1);
22}
23
7606fd62 24# No support for transactions; warn and continue
ac50f57b 25sub txn_begin {
7606fd62 26 carp_once <<'EOF' unless $ENV{DBIC_DBDFILE_TXN_NOWARN};
27SQL::Statement-based drivers do not support transactions - proceeding at your own risk!
ac50f57b 28
7606fd62 29To turn off this warning, set the DBIC_DBDFILE_TXN_NOWARN environment variable.
30EOF
ac50f57b 31}
7606fd62 32sub txn_commit { 1; }
33sub txn_rollback { shift->throw_exception('Transaction protection was ignored and unable to rollback - your data is likely inconsistent!'); }
ac50f57b 34
35# Nor is there any last_insert_id support (unless the driver supports it directly)
36sub _dbh_last_insert_id { shift->throw_exception('SQL::Statement-based drivers do not support AUTOINCREMENT keys! You will need to specify the PKs directly.'); }
37
ac50f57b 381;
39
40=head1 NAME
41
7606fd62 42DBIx::Class::Storage::DBI::DBDFile - Base Class for SQL::Statement- / DBI::DBD::SqlEngine-based
ac50f57b 43DBD support in DBIx::Class
44
45=head1 SYNOPSIS
46
47This is the base class for DBDs that use L<SQL::Statement> and/or
7606fd62 48L<DBI::DBD::SqlEngine|DBI::DBD::SqlEngine::Developers>, ie: based off of
49L<DBD::File>. This class is used for:
ac50f57b 50
51=over
ac50f57b 52=item L<DBD::AnyData>
53=item L<DBD::TreeData>
ac50f57b 54=item L<DBD::CSV>
55=item L<DBD::DBM>
56=back
57
58=head1 IMPLEMENTATION NOTES
59
60=head2 Transactions
61
62These drivers do not support transactions (and in fact, even the SQL syntax for
7606fd62 63them). Therefore, any attempts to use txn_* or svp_* methods will warn you once
64and silently ignore the transaction protection.
ac50f57b 65
66=head2 SELECT ... FOR UPDATE/SHARE
67
68This also is not supported, but it will silently ignore these.
69
70=head1 AUTHOR
71
72See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
73
74=head1 LICENSE
75
76You may distribute this code under the same terms as Perl itself.
77
78=cut