Re: 'sequence' table?

[prev] [thread] [next] [Date index for 2004/09/20]

From: Dave Howorth
Subject: Re: 'sequence' table?
Date: 09:31 on 20 Sep 2004
I wrote:
 >> Is it possible to have a table called 'sequence'?
 >>
 >> I work with proteins, so sequence is kind of an important concept
 >> in the problem domain :)  I'm using Maypole, so I want/need the
 >> table name to be determined by the GUI requirements.

Thanks to everybody for the responses.

Charles Bailey replied:
 > You could comment out the warning, but this might come back to haunt
 > you if you ever switch DBMS, or if a future version of MySQL picks it
 > up as a reserved word.

I don't think that's a significant problem in that I won't even be able 
to create the database if that happens. So there won't be some insidious 
silent bug in the code.

 > Could you get by with something like "AASequence", or even
 > "Amino_acids", or head in the other direction with an abbreviation
 > like "Seq"?

But none of these look nice :) And Amino_acids is plural!  See at bottom.

Allen Day added:
 > just use your imagination, there are many alternatives.  i agree, it's
 > playing with fire to tread on any reserved keywords.
 >
 > tablename ideas: seq, feature, region, residues, protein...

Well it definitely isn't a feature or region or residues - those are in 
other tables!  And a protein is much more than just a sequence.

I wrote:
 >> When I use a database with a 'sequence'table, I see the following
 >> error:
 >>    Column 'sequence' in QD1::Entry clashes with built-in method at
 >>    /usr/local/share/perl/5.6.1/Class/DBI/Loader/mysql.pm line 24
 >> This is caused by error checking in Class::DBI because it has a
 >> method called 'sequence'. I believe I don't need the method because
 >> I'm using mysql. Is it possible to dispense with the method so I can
 >> use the name?

Tony Bowden pointed out:
> This appears to be due to a 'sequence' *column*  - not a 'sequence' table...

Oops! Quite correct, there is a table called 'sequence' but there is 
also a foregn-key column called 'sequence' in another table.

FWIW, I would prefer to call the table 'sequences' and the column 
'sequences_id', or perhaps 'sequence_id'. But I can't!

Perhaps I need to make my apparent constraints clearer.  I'm trying to 
use CDBI as part of Maypole and the power of their approach seems to 
derive in part from requiring particular names to be chosen for tables 
and columns. CDBI needs FK columns to be the same as table names. 
Maypole needs table names to be singular. It also presents them directly 
to the user so they have to be named exactly what the user will expect, 
rather than some expedient abbreviation or pseudo-synonym.

I guess I'll dig around for the appropriate Perl magic to suppress the 
warning, or perhaps there's some way to define aliases for tables & 
columns that would work in this situation.

Cheers, Dave

(message missing)

'sequence' table?
Dave Howorth 16:17 on 17 Sep 2004

Re: 'sequence' table?
Charles Bailey 20:26 on 17 Sep 2004

Re: 'sequence' table?
Allen Day 06:08 on 18 Sep 2004

Re: 'sequence' table?
Tony Bowden 07:40 on 18 Sep 2004

Re: 'sequence' table?
Dave Howorth 09:31 on 20 Sep 2004

Re: 'sequence' table?
Tony Bowden 10:04 on 20 Sep 2004

Re: 'sequence' table?
Dave Howorth 12:08 on 20 Sep 2004

Re: 'sequence' table?
Tony Bowden 16:44 on 20 Sep 2004

Re: 'sequence' table?
Dave Howorth 10:14 on 21 Sep 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52