From: Rafael Kitover Date: Sat, 6 Feb 2010 13:06:44 +0000 (+0000) Subject: Firebird: add POD, fix BLOB tests X-Git-Tag: v0.08121~73^2~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=90489c23e598723752c9e0d4b4da214ad05e3feb;p=dbsrgits%2FDBIx-Class.git Firebird: add POD, fix BLOB tests --- diff --git a/lib/DBIx/Class/Storage/DBI/InterBase.pm b/lib/DBIx/Class/Storage/DBI/InterBase.pm index f019ebb..1e46215 100644 --- a/lib/DBIx/Class/Storage/DBI/InterBase.pm +++ b/lib/DBIx/Class/Storage/DBI/InterBase.pm @@ -12,6 +12,20 @@ __PACKAGE__->mk_group_accessors(simple => qw/ _auto_incs /); +=head1 NAME + +DBIx::Class::Storage::DBI::InterBase - Driver for the Firebird RDBMS + +=head1 DESCRIPTION + +This class implements autoincrements for Firebird using C, sets the +limit dialect to C and provides preliminary +L support. + +For ODBC support, see L. + +=cut + sub _prep_for_execute { my $self = shift; my ($op, $extra_bind, $ident, $args) = @_; @@ -114,3 +128,35 @@ sub format_datetime { } 1; + +=head1 CAVEATS + +=over 4 + +=item * + +C support only works for Firebird versions 2 or greater. To +work with earlier versions, we'll need to figure out how to retrieve the bodies +of C triggers and parse them for the C name. + +=item * + +C values are written with precision of 4 numbers after the decimal +point for seconds, but read with only second precision. + +If you know of a session variable we can set to control how timestamps look as +strings, please let us know (via RT.) + +Otherwise we'll need to rewrite the produced SQL for timestamps, at some point. + +=back + +=head1 AUTHOR + +See L and L. + +=head1 LICENSE + +You may distribute this code under the same terms as Perl itself. + +=cut diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm index b5eefa3..a17fa4a 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm @@ -15,6 +15,10 @@ through ODBC All functionality is provided by L, see that module for details. +To build the ODBC driver for Firebird on Linux for unixODBC, see: + +L + =cut __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::ODBC::Firebird'); diff --git a/t/750firebird.t b/t/750firebird.t index a1cecad..5b79b23 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -24,8 +24,8 @@ my @info = ( my $schema; -foreach my $info (@info) { - my ($dsn, $user, $pass) = @$info; +foreach my $conn_idx (0..1) { + my ($dsn, $user, $pass) = @{ $info[$conn_idx] }; next unless $dsn; @@ -118,9 +118,9 @@ EOF # test blobs (stolen from 73oracle.t) SKIP: { - eval { $dbh->do('DROP TABLE bindtype_test') }; + eval { $dbh->do('DROP TABLE bindtype_test2') }; $dbh->do(q[ - CREATE TABLE bindtype_test + CREATE TABLE bindtype_test2 ( id INT PRIMARY KEY, bytea INT, @@ -129,15 +129,13 @@ EOF ) ]); - last SKIP; # XXX blob ops cause segfaults! - my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) ); $binstr{'large'} = $binstr{'small'} x 1024; my $maxloblen = length $binstr{'large'}; local $dbh->{'LongReadLen'} = $maxloblen; - my $rs = $schema->resultset('BindType'); + my $rs = $schema->resultset('BindType2'); my $id = 0; foreach my $type (qw( a_blob a_clob )) { diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index a3e4484..6f5169c 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -9,6 +9,7 @@ __PACKAGE__->load_classes(qw/ Artist SequenceTest BindType + BindType2 Employee CD FileColumn diff --git a/t/lib/DBICTest/Schema/BindType2.pm b/t/lib/DBICTest/Schema/BindType2.pm new file mode 100644 index 0000000..0ebbb8e --- /dev/null +++ b/t/lib/DBICTest/Schema/BindType2.pm @@ -0,0 +1,29 @@ +package # hide from PAUSE + DBICTest::Schema::BindType2; + +use base qw/DBICTest::BaseResult/; + +__PACKAGE__->table('bindtype_test2'); + +__PACKAGE__->add_columns( + 'id' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'bytea' => { + data_type => 'bytea', + is_nullable => 1, + }, + 'a_blob' => { + data_type => 'blob', + is_nullable => 1, + }, + 'a_clob' => { + data_type => 'clob', + is_nullable => 1, + }, +); + +__PACKAGE__->set_primary_key('id'); + +1; diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index 4d7905f..1459edc 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,6 +1,6 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Sat Jan 30 19:18:55 2010 +-- Created on Sat Feb 6 08:01:11 2010 -- ; @@ -27,6 +27,16 @@ CREATE TABLE bindtype_test ( ); -- +-- Table: bindtype_test2 +-- +CREATE TABLE bindtype_test2 ( + id INTEGER PRIMARY KEY NOT NULL, + bytea blob, + a_blob blob, + a_clob clob +); + +-- -- Table: collection -- CREATE TABLE collection (