[Dbix-class] Moose

Peter Rabbitson rabbit+dbic at rabbit.us
Mon Jul 19 22:40:41 GMT 2010


On Sun, Jul 18, 2010 at 03:25:50PM -0500, David Ihnen wrote:
> On Sun, Jul 18, 2010 at 2:30 PM, Leandro Hermida <softdev at leandrohermida.com
> 
> > About the querying question, Hibernate and JPA (which I mentioned earlier)
> > have their own query languages
> >
> 
> Whoa.  Isn't that exactly what we're trying to avoid here?  Independent
> query language syntacticals?
> 
> 
> >  HQL and JPQL which somewhat resemble SQL but work with objects.  I would
> > imagine a Moose-based DBIC would have one as well?
> >
> 
> I would most emphatically scream, NO.  Just like DBIX::Class, the 'query
> language' would be described through perlish data structures - no
> independent syntax.  We have enough languages already!
> 
> 
> > If you use HQL I believe you can actually make a query that fetches all
> > objects who's related object's attribute X is Y, see here
> > http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html.
> > I believe it translates HQL into SQL before making the query in a
> > transparent way.
> >
> 
> We have enough language syntaxes already.  We do not need to invent, YET
> ANOTHER language.  I have very strong reservations regarding the
> appropriateness of this kind of solution to the ORM problem.
> 

David, you are spot on, except you are not taking your idea far enough. Yes
we can currently specify queries via concise, clear and (most importantly)
modular perl. The goal however is to erase the bondary between perl and the
underlying storage. In other words to have things like:

my $matches = grep $_->name =~ /wohoo/, $rs;

Execute via an actual SQL RLIKE under the hood. Now *that* is what people
should be excited about, not about "I want to store objects".

What DBIC and its younger brother are about is making random data more
accessible, not provide yet-another-data-warehousing-framework. So if you
or anyone feels excited about this - pop into #dbix-class and ask mst or
frew how you can help.

Cheers



More information about the DBIx-Class mailing list