Start producing join stmts
[dbsrgits/SQL-Abstract-2.0-ish.git] / lib / SQL / Abstract / AST / v1.pm
index f492580..f0ed698 100644 (file)
@@ -68,7 +68,16 @@ class SQL::Abstract::AST::v1 extends SQL::Abstract {
   }
 
   method _join(ArrayRef $ast) {
-    
+    my (undef, @items) = @$ast;
+  
+    croak "invalid component in JOIN: $_" unless ArrayRef->check($items[0]);
+    my @output = 'JOIN';
+
+    # TODO: Validation of inputs
+    return 'JOIN '. $self->dispatch(shift @items) .
+                  ' ON (' .
+                  $self->_recurse_where( \@items ) . ')';
+      
   }
 
   method _list(ArrayRef $ast) {