Re: Following links in QB
Eero af Heurlin <eero.afheurlin-ZpG/[email protected]>
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Piotras wrote:
>>Hi,
>>
>>Currently the query builder only has limited supports for link
>>properties, namely the dot syntax in add_constraint(). I'd like to
>>propose the following new methods as an advanced version of the join()
>>method proposed earlier by Piotras.
>
>
> The idea of join was to help MidCOM ACL.
>
There are plenty of other use cases as well.
> Few questions:
>
> 1. How it affects ML objects?
>
I dunno, I don't think it should affect them differently from other objects
>
> 2. What about limit or group?
>
Limits quite naturally only affect the main query (unless you can think
of some smart way where they would be usefull in backward join).
groups are just parentheses so you can start and end groups in the
subquoerybuilders as normal.
much more interesting is add_order, though it only makes sense with
forward join and in theory is already supported with the dot syntax
(it's a valid order for QB but i'd guess it's silently dropped, at least
it won't work: try listing members ordered by person.lastname)
>
> 3. How select will look like in such cases?
>
In the first prototype ("naive") implmentation it would probably be
bunch of separate queries handled by QB, when the concept works then
optimized into subqueries and joins (in fact QB can be smart here and
ask the DBA layer what features the DB supports and then use
joins/subqueries/multiple queries as it sees best)
Optimizing the actual SQL queries will be a lot of work but even with
very simple optimizations it should be fast enough.
/Rambo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDtTdKk2FlZlXdE74RA9JKAJ9p0Q1V1vp7fIhPHG+rrTtGeJtHTQCff6Gi
rGiRq61hsIDZRVnEUcOdJRE=
=e2KR
-----END PGP SIGNATURE-----