[BioSQL-l] Python ORM mapping for BioSQL

Peter biopython at maubp.freeserve.co.uk
Fri Nov 28 13:41:52 EST 2008


On Fri, Nov 28, 2008 at 6:31 PM, Hilmar Lapp <hlapp at gmx.net> wrote:
>
> On Nov 28, 2008, at 5:43 AM, Peter wrote:
>
>> Why not this:
>>
>> CREATE TABLE taxon_name (
>>      taxon_id          INT(10) UNSIGNED NOT NULL,
>>      name              VARCHAR(255) BINARY NOT NULL,
>>      name_class        VARCHAR(32) BINARY NOT NULL,
>>      PRIMARY KEY (taxon_id,name,name_class)
>> ) TYPE=INNODB;
>
>
> It's part of the changes planned for the next release indeed.

By next release, do you mean BioSQL v1.0.2 or v1.1.0 here?

> At the time this was written it didn't seem to matter much as they are really
> semantically equivalent, and ORM tools weren't around much at the time :-)

I see - that kind of explains the reason why some tables have explicit
composite primary keys, while others just have a unique set of fields.

> I do hope that no-one is using a dynamically configuring ORM at run time so
> that this change can be a drop-in replacement that's fully backwards
> compatible.

Some dynamically configuring ORM code would never have coped with
these tables in the first place - so it doesn't matter here.  In other
cases the user can tell the ORM to treat the tuple
(taxon_id,name,name_class) as a primary key - and this should still be
fine even when this is explicit in the database schema.  I expect (and
hope) this will be a backwards compatible change.

Peter


More information about the BioSQL-l mailing list