Re: $dbh and CDBI::Loader

[prev] [thread] [next] [Date index for 2005/04/01]

From: Dana Hudes
Subject: Re: $dbh and CDBI::Loader
Date: 15:20 on 01 Apr 2005
Hmm. The documentation in Class::DBI::Loader::Generic
says:
find_class

       Returns a tables class.

           my $class = $loader->find_class($table);


which most definitely is not a database connection handle.
I see though that you're trying to make it generic. If  I know my class 
name is Foo, you are saying use Foo->db_Main to get the connection.

Further thinking about this recalls that Ima::DBI is at the heart of all 
of these libraries. Reading the pod for Ima::DBI, I find
	my @database_handles = Foo->db_handles(@db_names);

Probably it IS best to use db_Main though....




On Fri, 1 Apr 2005, Kingsley Kerce wrote:

> Dana Hudes writes:
>  > I need to acess the functions of Postgresql via the driver. These are of 
>  > the form:
>  > 	$dbh->func($filename, 'lo_import');
>  > 
>  > I am using Class::DBI::Loader. I give it the DSN etc. . How do I get the 
>  > $dbh database handle?
> 
> $dbh = $loader->find_class('table_name')->db_Main
> # where $loader is a CDBI::Loader object and table_name is the name of
> # a table in your schema
> 
> Kings
> 
> 

Re: $dbh and CDBI::Loader
Dana Hudes 15:20 on 01 Apr 2005

Generated at 14:42 on 11 Apr 2005 by mariachi v0.52