[Bioperl-guts-l] bioperl-db/Bio/DB DBContextI.pm, 1.3, 1.4 SimpleDBContext.pm, 1.8, 1.9

Hilmar Lapp lapp at dev.open-bio.org
Sat Jun 2 21:57:05 EDT 2007


Update of /home/repository/bioperl/bioperl-db/Bio/DB
In directory dev.open-bio.org:/tmp/cvs-serv10347/Bio/DB

Modified Files:
	DBContextI.pm SimpleDBContext.pm 
Log Message:
Adding support for schemas in PostgreSQL. Though I think this should work,
it is not tested yet.


Index: SimpleDBContext.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-db/Bio/DB/SimpleDBContext.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** SimpleDBContext.pm	4 Jul 2006 04:38:07 -0000	1.8
--- SimpleDBContext.pm	3 Jun 2007 01:57:03 -0000	1.9
***************
*** 106,109 ****
--- 106,112 ----
                          if supplied, other parameters will not change
                          or add to the value (see method dsn())
+              -schema    the schema under which the database tables
+                         reside, if the driver needs this (for example,
+                         for PostgreSQL)
  
  =cut
***************
*** 120,123 ****
--- 123,127 ----
          $password,
          $port,
+         $schema,
          ) = $self->_rearrange([qw(DSN
                                    DBNAME
***************
*** 127,130 ****
--- 131,135 ----
  				  PASS
  				  PORT
+                                   SCHEMA
  				  )], at args);
  
***************
*** 136,139 ****
--- 141,145 ----
      $self->password($password) if defined($password);
      $self->port($port) if defined($port);
+     $self->schema($schema) if defined($schema);
      return $self;
  }
***************
*** 365,367 ****
--- 371,392 ----
  }
  
+ =head2 schema
+ 
+  Title   : schema
+  Usage   : $dbc->schema($newval)
+  Function: Get/set the schema in which the database tables reside.
+  Example : 
+  Returns : value of schema (a scalar)
+  Args    : on set, new value (a scalar or undef, optional)
+ 
+ 
+ =cut
+ 
+ sub schema{
+     my $self = shift;
+ 
+     return $self->{'schema'} = shift if @_;
+     return $self->{'schema'};
+ }
+ 
  1;

Index: DBContextI.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-db/Bio/DB/DBContextI.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DBContextI.pm	26 Aug 2005 19:34:14 -0000	1.3
--- DBContextI.pm	3 Jun 2007 01:57:03 -0000	1.4
***************
*** 246,248 ****
--- 246,278 ----
  }
  
+ =head2 schema
+ 
+  Title   : schema
+  Usage   : $dbc->schema($newval)
+  Function: Get/set the schema in which the database tables reside.
+ 
+            A schema is typically equivalent to a namespace for a
+            collection of tables within a database. In Oracle, the
+            notion of a schema is synonymous with that of the user (all
+            database objects of a user belong to the schema of the same
+            name as the user) and hence can be omitted. In PostgreSQL,
+            since v7.4 schemas can delineate collections of tables
+            within a database (which in concept is more similar to a
+            user in Oracle).
+ 
+            For most drivers and database instances this will not be
+            needed.
+ 
+  Example : 
+  Returns : value of schema (a scalar)
+  Args    : on set, new value (a scalar or undef, optional)
+ 
+ 
+ =cut
+ 
+ sub schema{
+     my ($self, at args) = @_;
+     $self->throw_not_implemented();
+ }
+ 
  1;



More information about the Bioperl-guts-l mailing list