consolidate other things
Matt S Trout [Tue, 1 Oct 2019 03:39:12 +0000 (03:39 +0000)]
lib/SQL/Abstract/ExtraClauses.pm

index e4750a9..39e6f51 100644 (file)
@@ -56,10 +56,18 @@ sub register_extensions {
       'select.having'
         => sub { $_[0]->expand_expr($_[2]) },
     ],
-    (map +("${_}er" => [ do { my $x = $_; (map +($_ => "_${x}_${_}"), qw(join from_list alias)) } ]), qw(expand render)),
+    (map +(
+      "${_}er" => [
+        do {
+          my $x = $_;
+          (map +($_ => "_${x}_${_}"), qw(join from_list alias))
+        }
+       ]
+    ), qw(expand render)),
+    binop_expander => [ as => '_expand_op_as' ],
+    renderer => [ as => '_render_as' ],
+    expander => [ cast => '_expand_cast' ],
   );
-  $sqla->binop_expander(as => $self->cb('_expand_op_as'));
-  $sqla->renderer(as => $self->cb('_render_as'));
 
   $sqla->clauses_of(update => sub {
     my ($self, @clauses) = @_;
@@ -120,8 +128,6 @@ sub register_extensions {
     $sqla->clause_renderer("${stmt}.with" => $w_rdr);
   }
 
-  $sqla->expander(cast => $self->cb('_expand_cast'));
-
   $sqla->clause_expanders(
     "select.from", $self->cb('_expand_from_list'),
     "update.target", $self->cb('_expand_update_clause_target'),