move warning suppression into ::DBI::InterBase
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Storage / DBI / ODBC / Firebird.pm
CommitLineData
dff4c3a3 1package DBIx::Class::Storage::DBI::ODBC::Firebird;
2
3use strict;
4use warnings;
5use base qw/DBIx::Class::Storage::DBI::InterBase/;
6use mro 'c3';
7
dff4c3a3 8=head1 NAME
9
10DBIx::Class::Storage::DBI::ODBC::Firebird - Driver for using the Firebird RDBMS
11through ODBC
12
d1fc96c7 13=head1 DESCRIPTION
dff4c3a3 14
32323fc2 15Most functionality is provided by L<DBIx::Class::Storage::DBI::Interbase>, see
dff4c3a3 16that module for details.
17
90489c23 18To build the ODBC driver for Firebird on Linux for unixODBC, see:
19
20L<http://www.firebirdnews.org/?p=1324>
21
d1fc96c7 22This driver does not suffer from the nested statement handles across commits
23issue that the L<DBD::InterBase|DBIx::Class::Storage::DBI::InterBase> based
24driver does. This makes it more suitable for long running processes such as
25under L<Catalyst>.
26
1ae0a36c 27=cut
28
c5827074 29# XXX seemingly no equivalent to ib_time_all from DBD::InterBase via ODBC
32323fc2 30sub connect_call_datetime_setup { 1 }
1ae0a36c 31
9633951d 32# we don't need DBD::InterBase-specific initialization
33sub _init { 1 }
34
35# ODBC uses dialect 3 by default, good
36sub _set_sql_dialect { 1 }
37
5c6ed0b5 38# releasing savepoints doesn't work, but that shouldn't matter
39sub _svp_release { 1 }
40
8f0a1e07 41sub _populate_server_info {
42 goto &DBIx::Class::Storage::DBI::_populate_server_info
43}
44
c5827074 45sub datetime_parser_type {
46 'DBIx::Class::Storage::DBI::ODBC::Firebird::DateTime::Format'
47}
48
49package # hide from PAUSE
50 DBIx::Class::Storage::DBI::ODBC::Firebird::DateTime::Format;
51
52# inherit parse/format date
53our @ISA = 'DBIx::Class::Storage::DBI::InterBase::DateTime::Format';
54
55my $timestamp_format = '%Y-%m-%d %H:%M:%S'; # %F %T, no fractional part
56my $timestamp_parser;
57
58sub parse_datetime {
59 shift;
60 require DateTime::Format::Strptime;
61 $timestamp_parser ||= DateTime::Format::Strptime->new(
62 pattern => $timestamp_format,
63 on_error => 'croak',
64 );
65 return $timestamp_parser->parse_datetime(shift);
66}
67
68sub format_datetime {
69 shift;
70 require DateTime::Format::Strptime;
71 $timestamp_parser ||= DateTime::Format::Strptime->new(
72 pattern => $timestamp_format,
73 on_error => 'croak',
74 );
75 return $timestamp_parser->format_datetime(shift);
76}
77
1ae0a36c 781;
79
32323fc2 80=head1 CAVEATS
81
a499b173 82=over 4
83
84=item *
85
32323fc2 86This driver (unlike L<DBD::InterBase>) does not currently support reading or
87writing C<TIMESTAMP> values with sub-second precision.
88
a499b173 89=back
90
dff4c3a3 91=head1 AUTHOR
92
93See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
94
95=head1 LICENSE
96
97You may distribute this code under the same terms as Perl itself.
98
99=cut