Gossamer Forum
Home : Products : Gossamer Links : Discussions :

does DB->table actually connect?

Quote Reply
does DB->table actually connect?
Hi there,

does my $linkdb = $DB->table ('Links'); actually do anything or is it just declaring the value of the variable?

In otherwords, if I had extraneous declarations like that which were to other tables (that aren't used right now), do the declarations actually slow things down?

thanks, Hope I was clear in the question.

peace.
Quote Reply
Re: [klangan] does DB->table actually connect? In reply to
Calling the table method creates a table object or returns a cached object if it exists.

It is very quick so won't slow things down.
Quote Reply
Re: [Paul] does DB->table actually connect? In reply to
thanks Paul,

mighty helpful.

peace.

klangan

Last edited by:

klangan: Feb 27, 2003, 2:36 PM
Quote Reply
Re: [klangan] does DB->table actually connect? In reply to
Hi,

No, you don't actually connect to the database until you do a ->select, ->update, etc.

The ->table() method also caches the def files, so calling it multiple times does not slow things down.

Cheers,

Alex
--
Gossamer Threads Inc.