Hello John,

Adding support for relationship names actually introduces ambiguity here.
Now when faced with a prefix, it could be a table alias, a table name, or a
relationship name, all of which can overlap.  While I think this won't be
too bad in the limited scope of the "distinct" param, I worry about it being
added to the actual query params.

I didn't want to limit the relationship name only to distinct. It's especially useful for query.

Hm, I guess I can break out my secret ambiguity-breaker weapon and just
document the tn_... column name aliases :)

I have seen this in the generated sql, but I don't think it is an help in this case. You have to know the order of the tables. This is no problem in a static query, but consider the following dynamic query:

my @param = ();
my %with  = ();
if ($region) {
    push @param, 'region => '.$region;
    $with{prices} = 1;
}
elsif ($type) {
    push @param, 'type => '.$type;
    $with{prices2} = 1;
}

my $prod = Product::Manager->get_products(
    with   => [keys %with],
    query  => [EMAIL PROTECTED],
);

Now, if region and type would be amiguity, I would like to prefix them with 'prices' or 'prices2' (which is the realtionship name). The table order would make the above code unneccessary more complex.

What about this rule:
1. if a column is not prefixed, it is the main object.
2. every other column has to be prefixed with the relationship name

So no table order is ever important. And m:m relationships wouldn't require any special treatment (by using tN you have to add +2).


To the changes in CVS. I tried them and they work good. Even "fetch_only => 1" works. It fetches only the main object, but doesn't add a distinct.

Thanks.


Bye, Uwe


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to