Commit | Line | Data |
7606fd62 |
1 | package DBIx::Class::Storage::DBI::DBDFile; |
ac50f57b |
2 | |
3 | use strict; |
4 | use base 'DBIx::Class::Storage::DBI'; |
5 | use mro 'c3'; |
7606fd62 |
6 | use DBIx::Class::Carp; |
ac50f57b |
7 | use 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 |
14 | sub _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 |
18 | sub _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 |
25 | sub txn_begin { |
7606fd62 |
26 | carp_once <<'EOF' unless $ENV{DBIC_DBDFILE_TXN_NOWARN}; |
27 | SQL::Statement-based drivers do not support transactions - proceeding at your own risk! |
ac50f57b |
28 | |
7606fd62 |
29 | To turn off this warning, set the DBIC_DBDFILE_TXN_NOWARN environment variable. |
30 | EOF |
ac50f57b |
31 | } |
7606fd62 |
32 | sub txn_commit { 1; } |
33 | sub 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) |
36 | sub _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 |
38 | 1; |
39 | |
40 | =head1 NAME |
41 | |
7606fd62 |
42 | DBIx::Class::Storage::DBI::DBDFile - Base Class for SQL::Statement- / DBI::DBD::SqlEngine-based |
ac50f57b |
43 | DBD support in DBIx::Class |
44 | |
45 | =head1 SYNOPSIS |
46 | |
47 | This is the base class for DBDs that use L<SQL::Statement> and/or |
7606fd62 |
48 | L<DBI::DBD::SqlEngine|DBI::DBD::SqlEngine::Developers>, ie: based off of |
49 | L<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 | |
62 | These drivers do not support transactions (and in fact, even the SQL syntax for |
7606fd62 |
63 | them). Therefore, any attempts to use txn_* or svp_* methods will warn you once |
64 | and silently ignore the transaction protection. |
ac50f57b |
65 | |
66 | =head2 SELECT ... FOR UPDATE/SHARE |
67 | |
68 | This also is not supported, but it will silently ignore these. |
69 | |
70 | =head1 AUTHOR |
71 | |
72 | See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>. |
73 | |
74 | =head1 LICENSE |
75 | |
76 | You may distribute this code under the same terms as Perl itself. |
77 | |
78 | =cut |