[Dbix-class] SQLA refactor: proposal

Matt S Trout dbix-class at trout.me.uk
Tue Nov 20 20:14:35 GMT 2007


Far, far too much of the code is currently in _recurse_where, and the DWIM
AST provides quite a few ways to say the same thing. From a few hours'
thought, I think dduncan's

http://search.cpan.org/~duncand/Language-MuldisD-0.9.1/lib/Language/MuldisD/Core.pod

provides most of what we'll need - certainly the SELECT list, simple FROM
and WHERE stuff is covered.

There are a few SQL-y operators such as LIKE or BETWEEN that don't seem to
be in there, but I don't see why they can't be in sqla.Core.Str.Between
etc.

So I think the first stage is to create an SQL::Abstract::Parser that
parses SQLA syntax into MuldisD (+extra sqla. definitions) and an
SQL::Abstract::Producer::SQL that converts from MuldisD to SQL, and then
make core SQL::Abstract use that and pass all tests.

Thoughts?

-- 
      Matt S Trout       Catalyst and DBIx::Class consulting and support -
   Technical Director      http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Christmas fun in collectable card game form -
                           http://www.shadowcat.co.uk/resources/2007_trading/



More information about the DBIx-Class mailing list