From: Prog Rammer Date: Mon, 27 Aug 2012 16:08:47 +0000 (-0500) Subject: another way to join X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70a14d95f224db56555bce9a2d0ecf1950f5f7dc;p=dbsrgits%2FData-Query.git another way to join from ilmari++ in irc --- diff --git a/t/expr-helpers.t b/t/expr-helpers.t index 1f0bff4..79ee600 100644 --- a/t/expr-helpers.t +++ b/t/expr-helpers.t @@ -21,14 +21,30 @@ dq_sql_is ['SELECT * FROM foo'], 'simple select'; -dq_sql_is - Join( - Select([ Identifier('*') ], Identifier('foo')), - Identifier('bar'), - perl_operator('==', Identifier('foo', 'x'), Identifier('bar', 'y')) - ), - ['SELECT * FROM foo JOIN bar ON foo.x = bar.y'], - 'join on with dots'; +{ + # should these both be allowed, and result in the same SQL? + + dq_sql_is + Join( + Select([ Identifier('*') ], Identifier('foo')), + Identifier('bar'), + perl_operator('==', Identifier('foo', 'x'), Identifier('bar', 'y')) + ), + ['SELECT * FROM foo JOIN bar ON foo.x = bar.y'], + 'join on with dots (Join Select)'; + + dq_sql_is + Select( + [ Identifier('*') ], + Join( + Identifier('foo'), + Identifier('bar'), + perl_operator('==', Identifier('foo', 'x'), Identifier('bar', 'y')) + ), + ), + ['SELECT * FROM foo JOIN bar ON foo.x = bar.y'], + 'join on with dots (Select Join)'; +} dq_sql_is Where(