Re: [siesta-dev] prefixing tablenames?

[prev] [thread] [next] [lurker] [Date index for 2004/10/31]

From: Bowen Dwelle
Subject: Re: [siesta-dev] prefixing tablenames?
Date: 21:15 on 31 Oct 2004

Richard Clamp wrote:
> 
> On 18 Oct 2004, at 11:47, Simon Wistow wrote:
> 
>> On Sat, Oct 16, 2004 at 09:32:07AM -0700, Bowen Dwelle said:
>>
>>> If anyone wants the updated versions, I've posted them here:
>>> http://www.dwelle.org/eg/Siesta-update.tar.gz
>>
>>
>> I'll mereg these later unless Richard has any strong objections.
> 
> 
> I do, it's the wrong way round.
> 
> The change should be to add a set_up_table to Siesta::DBI which can 
> chain up via SUPER to the real Class::DBI::$foo->sup_up_table, not to 
> hack all the database classes.

Trying to get this to work the right way as Richard suggests, I created 
Siesta::DBI

sub set_up_table {
   my ($class, $table_name)  = @_;
   __PACKAGE__->SUPER::set_up_table( $Siesta::Config::TABLE_PREFIX . 
$table_name);
}

when I run nacho with this in place, I get

bdwelle:~> nacho show-members info-list
Siesta::List can't SELECT id
FROM   siesta_deferred
WHERE  name = ?
: DBD::mysql::st execute failed: Unknown column 'name' in 'where clause' 
[for Statement "SELECT id
FROM   siesta_deferred
WHERE  name = ?
"] at /home/bdwelle/lib/DBIx/ContextualFetch.pm line 51.
  at /home/bdwelle/bin/nacho line 357
bdwelle:~>

some sort of inheritance problem... ?   Note that set_up_table is 
specific to Class::DBI::mysql -- it doesn't exist in Class::DBI itself
There's stuff above here

Generated at 14:00 on 11 Nov 2004 by mariachi 0.52