clarify generate_pod doc
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / Base.pm
index ba188d8..6ee29e3 100644 (file)
@@ -65,6 +65,7 @@ __PACKAGE__->mk_group_accessors('simple', qw/
                                 _rewriting_result_namespace
                                 use_namespaces
                                 result_namespace
+                                generate_pod
 /);
 
 =head1 NAME
@@ -158,6 +159,16 @@ next major version upgrade:
 
     __PACKAGE__->naming('v5');
 
+=head2 generate_pod
+
+By default POD will be generated for columns and relationships, using database
+metadata for the text if available and supported.
+
+Reading database metadata (e.g. C<COMMENT ON TABLE some_table ...>) is only
+supported for Postgres right now.
+
+Set this to C<0> to turn off all POD generation.
+
 =head2 relationship_attrs
 
 Hashref of attributes to pass to each generated relationship, listed
@@ -419,6 +430,7 @@ sub new {
     $self->_check_back_compat;
 
     $self->use_namespaces(1) unless defined $self->use_namespaces;
+    $self->generate_pod(1)   unless defined $self->generate_pod;
 
     $self;
 }
@@ -1379,6 +1391,8 @@ sub _make_pod {
     my $class  = shift;
     my $method = shift;
 
+    return unless $self->generate_pod;
+
     if ( $method eq 'table' ) {
         my ($table) = @_;
         $self->_pod( $class, "=head1 NAME" );
@@ -1437,7 +1451,6 @@ sub _pod_cut {
     $self->_raw_stmt( $class, "\n=cut\n" );
 }
 
-
 # Store a raw source line for a class (for dumping purposes)
 sub _raw_stmt {
     my ($self, $class, $stmt) = @_;