[Bast-commits] r8571 - in DBIx-Class/0.08/branches/storage-interbase: lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/ODBC t t/lib t/lib/DBICTest t/lib/DBICTest/Schema

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Sat Feb 6 13:06:46 GMT 2010


Author: caelum
Date: 2010-02-06 13:06:44 +0000 (Sat, 06 Feb 2010)
New Revision: 8571

Added:
   DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema/BindType2.pm
Modified:
   DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm
   DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm
   DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
   DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema.pm
   DBIx-Class/0.08/branches/storage-interbase/t/lib/sqlite.sql
Log:
Firebird: add POD, fix BLOB tests

Modified: DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm	2010-02-06 12:35:31 UTC (rev 8570)
+++ DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/InterBase.pm	2010-02-06 13:06:44 UTC (rev 8571)
@@ -12,6 +12,20 @@
   _auto_incs
 /);
 
+=head1 NAME
+
+DBIx::Class::Storage::DBI::InterBase - Driver for the Firebird RDBMS
+
+=head1 DESCRIPTION
+
+This class implements autoincrements for Firebird using C<RETURNING>, sets the
+limit dialect to C<FIRST X SKIP X> and provides preliminary
+L<DBIx::Class::InflateColumn::DateTime> support.
+
+For ODBC support, see L<DBIx::Class::Storage::DBI::ODBC::Firebird>.
+
+=cut
+
 sub _prep_for_execute {
   my $self = shift;
   my ($op, $extra_bind, $ident, $args) = @_;
@@ -114,3 +128,35 @@
 }
 
 1;
+
+=head1 CAVEATS
+
+=over 4
+
+=item *
+
+C<last_insert_id> 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<BEFORE INSERT> triggers and parse them for the C<GENERATOR> name.
+
+=item *
+
+C<TIMESTAMP> 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<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut

Modified: DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm	2010-02-06 12:35:31 UTC (rev 8570)
+++ DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm	2010-02-06 13:06:44 UTC (rev 8571)
@@ -15,6 +15,10 @@
 All functionality is provided by L<DBIx::Class::Storage::DBI::Interbase>, see
 that module for details.
 
+To build the ODBC driver for Firebird on Linux for unixODBC, see:
+
+L<http://www.firebirdnews.org/?p=1324>
+
 =cut
 
 __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::ODBC::Firebird');

Modified: DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-06 12:35:31 UTC (rev 8570)
+++ DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-06 13:06:44 UTC (rev 8571)
@@ -24,8 +24,8 @@
 
 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 @@
 
 # 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 @@
     )
     ]);
 
-    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 )) {

Added: DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema/BindType2.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema/BindType2.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema/BindType2.pm	2010-02-06 13:06:44 UTC (rev 8571)
@@ -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;

Modified: DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema.pm	2010-02-06 12:35:31 UTC (rev 8570)
+++ DBIx-Class/0.08/branches/storage-interbase/t/lib/DBICTest/Schema.pm	2010-02-06 13:06:44 UTC (rev 8571)
@@ -9,6 +9,7 @@
   Artist
   SequenceTest
   BindType
+  BindType2
   Employee
   CD
   FileColumn

Modified: DBIx-Class/0.08/branches/storage-interbase/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/lib/sqlite.sql	2010-02-06 12:35:31 UTC (rev 8570)
+++ DBIx-Class/0.08/branches/storage-interbase/t/lib/sqlite.sql	2010-02-06 13:06:44 UTC (rev 8571)
@@ -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 @@
 );
 
 --
+-- 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 (




More information about the Bast-commits mailing list