[BioSQL-l] Tables without a (composite) primary key

Raoul Jean Pierre Bonnal raoul.bonnal at itb.cnr.it
Thu Nov 6 12:23:43 UTC 2008


Dear Peter, 
I'm writing the wrapper for BioRuby using DataMapper an ORM (Active Record is 
similar).

I think we can cosider to move or branch BioSQL' schema to the approach 
suggested by this kind of ORMs, with a pk for every table named "id" and a 
table name in plural. Fk names are quite correct.

PS: DataMapper handles very well composite PK, much better tha ActiveRecord.

Il giovedì 06 novembre 2008 12:53:13 Peter ha scritto:
> I've recently been looking into some object-relational mappers which
> caused me to look more closely at the BioSQL schema.  Many of these
> packages require a primary key, but not all can cope with a composite
> primary key.  However, some BioSQL tables don't have any primary key
> at all.
>
> Several BioSQL tables have composite primary keys, for example the
> term_dbxref table has a composite key of (term_id, dbxref_id), and
> also an index on dbxref_id as well.
>
> However, some BioSQL tables do not have a primary key, for example:
>
> -- corresponds to the names table of the NCBI taxonomy databaase
> CREATE TABLE taxon_name (
>        taxon_id		INT(10) UNSIGNED NOT NULL,
>        name		VARCHAR(255) BINARY NOT NULL,
>        name_class	VARCHAR(32) BINARY NOT NULL,
>        UNIQUE (taxon_id,name,name_class)
> ) TYPE=INNODB;
>
> CREATE INDEX taxnametaxonid ON taxon_name(taxon_id);
> CREATE INDEX taxnamename    ON taxon_name(name);
>
> Why don't taxon_name, bioentry_path, term_relationship,
> bioentry_qualifier_value, seqfeature_path have a primary key (just a
> uniqueness criteria)?
>
> Thanks,
>
> Peter
> _______________________________________________
> BioSQL-l mailing list
> BioSQL-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biosql-l




More information about the BioSQL-l mailing list