Re: join keys redux
Cyrus Harmon <ch-clsql-dl6SmSK5uza1Z/[email protected]>
| Newsgroups | gmane.lisp.clsql.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Kevin, Thanks for taking a look at this. Ok, so there are two separate issues here: 1. CLSQL def-view-class bug - we should fix the def-view-class stuff to allow for specifying lists for home-key and foreign key. 2. spec'ing values for a join slot - I'm suggesting that in multi-column join, the join value could be specified by a (constant) value rather than a column name. Imagine tables person ( person_id, name ) and pet ( owner_id, animal_type, name ) and I want to make a slot for dogs (I know, there are other ways to do this, but bear with be and imagine that some nut job has thousands of cats and I just want dogs :-)) I could specify the join as :home-key '(:person-id 'dog) :foreign-key (:owner-id :animal_type) and get what I want. I will check the docs and see if this is allowed in CommonSQL and will consider how to fix if so. If not, I'll consider the possibility of a CLSQL-specific extension to do this as I think it's useful (particularly in combination with #1 above). Thanks, Cyrus On Jan 24, 2005, at 11:32 AM, Kevin Rosenberg wrote: > I haven't taken the time to confirm your findings. But, yes -- any > backward incompatibility with CommonSQL is a bug. As for specifying a > value, I don't recall what in the CommonSQL API. But, it seems that > could a CLSQL-specific extension. Though in general, I consider joined > tables to rely on identity in a slot. But, if you are selecting a join > based on a value, that is done with a SELECT statement and is not part > of a table definition. But, perhaps I'm misunderstanding what you mean > about specifying a value in a table definition. > > Kevin