[Dbix-class] Chained resultsets and WHERE operators
Peter Rabbitson
rabbit+dbic at rabbit.us
Tue Nov 9 16:14:57 GMT 2010
Mike Raynham wrote:
>
> I have tested it, and it returns the results I would expect. I think
> the confusion comes from the order in which the WHERE expression is
> produced. If I were to write the SQL myself, without DBIx, I'd probably
It's DBIx::Class. DBIx is a namespace with hundreds of modules in it,
it is not fair to the respective authors to default DBIx to DBIx::Class.
If you want to abbreviate DBIC is common.
> swap around the column names and supplied dates, like this:
>
> SELECT * FROM my_table WHERE
> ($start_date >= start_date AND $start_date <= end_date) OR
> ($end_date >= start_date AND $end_date <= end_date)
>
> That way makes more sense to me, but I don't think I can write it like
> that using DBIx (unless I opt for creating SQL directly).
I don't see why not... ? Explain what do you perceive the holdup would
be.
More information about the DBIx-Class
mailing list