NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
DBIx::Class (Score:1)
where I don't know how to write the "mumble" part off the top of my head, but it's probably acc
Re:DBIx::Class (Score:1)
It solves the problem by getting rid of the class tree altogether and using Perl structures.
Here's another example of the sort of stuff I'm doing.
# We need a certain type of person
my $query = MyApp::Entity::Person->Fetch;
$query->condition('OptimizedFor', '==', 'fun');
$query->condition(
MyApp::SQL::Collection->OR(
MyApp::SQL::Clause->new('Lame', 'is null'),
MyApp::SQL::Clause->new('Age', 'new('Name', '!in', 'Adam', 'Bob', 'Whatever'),
)
);
# What projects are they in
my $projects = $query->traverse('FoundedProjects');
$projects->orderby('+Name');
$projects->limit(10);
my @projects = $projects->fetch( $dbh );
# Lets save that query so we can send it to bob,
# who is using the same application, but with Oracle.
$projects->save_as( 'WatchList.dat' );
As you can see, the SQL objects not only let me build up arbitrary nested structures, and create new queries with existing ones as subselects/joins, but the queries also serialize to a logical form, regardless of the database they will be executed on.
So it's basically an abstract tree for the queries of various types, that ignores the actual table names and column names (which might vary) and ignores the implementation method (for example, on Oracle, limit is implemented via a subselect).
This is where the main issue of Tree + Driver kicks in...
Reply to This
Parent
Re: (Score:1)
But you get the point.