Merge branch 'master' into dq
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract.pm
index f7b3986..d4867ab 100644 (file)
@@ -7,9 +7,9 @@ use Module::Runtime qw(use_module);
 use Moo;
 use namespace::clean;
 
-our $VERSION  = '1.72';
-
-$VERSION = eval $VERSION;
+our $VERSION  = '1.74';
+# This would confuse some packagers
+$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
 
 sub belch (@) {
   my($func) = (caller(1))[3];
@@ -110,9 +110,20 @@ has renderer_class => (
 after clear_renderer_class => sub { shift->clear_renderer };
 
 sub _build_renderer_class {
+  my ($self) = @_;
+  my ($class, @roles) = (
+    $self->_build_base_renderer_class, $self->_build_renderer_roles
+  );
+  return $class unless @roles;
+  return use_module('Moo::Role')->create_class_with_roles($class, @roles);
+}
+
+sub _build_base_renderer_class {
   use_module('Data::Query::Renderer::SQL::Naive')
 }
 
+sub _build_renderer_roles { () }
+
 sub _converter_args {
   my ($self) = @_;
   Scalar::Util::weaken($self);
@@ -421,7 +432,7 @@ SQL::Abstract - Generate SQL from Perl data structures
 
     my $sql = SQL::Abstract->new;
 
-    my($stmt, @bind) = $sql->select($table, \@fields, \%where, \@order);
+    my($stmt, @bind) = $sql->select($source, \@fields, \%where, \@order);
 
     my($stmt, @bind) = $sql->insert($table, \%fieldvals || \@values);
 
@@ -849,8 +860,8 @@ the source.
 The argument can be either an arrayref (interpreted as a list
 of field names, will be joined by commas and quoted), or a
 plain scalar (literal SQL, not quoted).
-Please observe that this API is not as flexible as for
-the first argument C<$table>, for backwards compatibility reasons.
+Please observe that this API is not as flexible as that of
+the first argument C<$source>, for backwards compatibility reasons.
 
 =item $where