The module constructs SQL statements from extremely little information. An example is probably in order.
Let's say I have a schema that has the following structure:
Now, let's say I want to get A.foo and E.bar in some query where "D.abcd = ?". Instead of me, the programmer, figuring out all the connectors (A->B, B->D, D->E), I make the following function call:
my $sql = $builder->build_sql( select => [ 'A.foo', 'E.bar', ], where => [ 'D.abcd = ?', ], );
That will return me the following SQL:
SELECT A.foo, E.bar FROM A join B using (ab) join D using (bd) join E using (de) WHERE D.abcd = ?
The algorithms used will work for any complexity of schema and are extremely fast. I also, since I use it for a reporting schema that is selectively denormalized, added the capability to take advantage of those denormalizations in the appropriate situations.
Does this exist? What features would be desirable? What should this be called?
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
20041019 Edit by castaway: Changed title from 'Is it on CPAN? (DBIx:: module)'
In reply to RFC - A multi table SQL Builder by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |