Re: Problems with set_sql and iterators
[prev]
[thread]
[next]
[Date index for 2005/06/21]
Michael Peters wrote:
>>Since CDBI *can* be used to perform aggregate searches on the tables the
>>classes are defined for, and since aggregate searches can't keep the
>>primary key information intact, it seems to me that this overload to
>>bool which marks the objects as false is strange. There is obviously
>>data there, I wish to use it, why say the object is false?
>
>
> In Class::DBI all objects correspond to a an actual row in the database
> and thus does not work with aggregate searches.
G'day Michael,
This is the answer I was looking for. I hadn't really considered the fact that
the results I was creating can't correspond to actual rows in the database and
thus cannot be mapped to C::D objects. Thankyou for pointing this out to me.
> Just because C::D
> doesn't complain loudly when you're doing it doesn't mean it will work.
>
> Maybe it should croak/die when you try to inflate a result row into an
> object that doesn't have all the primary keys. I'm sure a patch would be
> welcome.
I will try to put one together over the next couple of days.
> If you still want to use aggregate searches in your C::D based classes
> you can use your database handle (db_Main) to execute straight SQL and
> return the corresponding data structure, just don't try and turn them
> into C::D objects (sth_to_objects, construct, etc).
That makes sense.
>>If it's not considered a good idea to perform this sort of aggregate
>>search through CDBI like this then the documentation should say so.
>
> If it wasn't clear in the docs, then you're probably right. I'm sure
> Tony would accept would accept doc patches for the upcoming release.
I will try to put together an explanation over the next couple of days for this
as well. I've come into the discussion regarding the new release rather late.
What is the schedule for this?
Many thanks.
Jacinta
--
("`-''-/").___..--''"`-._ | Jacinta Richardson |
`6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia |
(_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 |
_..`--'_..-_/ /--'_.' ,' | contact@xxxxxxxxxxxx.xxx.xx |
(il),-'' (li),' ((!.-' | www.perltraining.com.au |
|
(message missing)
|