On 9/17/06 3:09 PM, Jonathan Vanasco wrote:
> I just noticed that QueryBuilder accepts multiple OR's

It accepts multiple anything, which is why query => ... takes a reference to
an array and not a hash (a hash would only allow one of each key name).

> Then i tested other fields, and noticed the same thing. I saw nothing about
> this in the docs to confirm this functionality  outright, though it is used in
> examples

It also doesn't say anything about only using each left-hand side "key" only
once, so it stands to reason that you don't have to limit yourself to that
:)  I'm about to make a release, but I've added a short clarification of
this to the docs.

> i also realized a query builder behavior that didn't come through on
> the docs...
> 
> or=> [
> 'id'=> { ne => $kw_args{'c'} },
> 'id'=> undef,
> ],
> is functionally the same as
> id=> {
> eq=> undef ,
> ne => $kw_args{'c'} }
> }

The second form is intentionally undocumented and may go away at some point,
so you should not rely on it.

> another thing i noticed, is that
> id => { eq=> [ 1,2,3] }
> creates
> ( id= 1 OR id= 2 OR id=3 )
> 
> while
> id => [ 1,2,3],
> creates
> id IN ( 1, 2,3 )
> 
> of course they're both functionally the same... but that caught my eye

They're both documented (under "Simple equality:" and "Comparisons:" in the
QueryBuilder docs) and both exist because sometimes people want that level
of control over the generated SQL.

-John



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to