[Catalyst] More complex Class::DBI::Sweet usage?

Perrin Harkins perrin at elem.com
Fri Jul 1 05:32:51 CEST 2005


On Thu, 2005-06-30 at 16:44 -0700, Jules Agee wrote:
> Would it make sense to use Class::DBI::Sweet in this example? If not,
> what approach would you use? I've got five tables, and the ipaddr and
> login tables are populated automatically from log files. I want to be
> able to see what systems a particular user logs in from, and which users
> are logging in from a particular system, either way.

What problem are you trying to solve?  How to write a report with
Class::DBI?  Ideally, don't use Class::DBI for it -- just write the SQL.
If you really want to use Class::DBI, and the end result can be a list
of objects of one type, add a custom query using set_sql to the class of
the object you want to get back.  For example, add a search_by_system()
query to your User class.  It should do the joins across the tables in
between.

- Perrin




More information about the Catalyst mailing list