new dev release
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Pg.pm
index 5a428ec..538c6be 100644 (file)
@@ -6,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI';
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04999_02';
+our $VERSION = '0.04999_12';
 
 =head1 NAME
 
@@ -35,6 +35,7 @@ sub _setup {
     $self->{db_schema} ||= 'public';
 }
 
+
 sub _table_uniq_info {
     my ($self, $table) = @_;
 
@@ -95,6 +96,32 @@ sub _table_uniq_info {
     return \@uniqs;
 }
 
+sub _table_comment {
+    my ( $self, $table ) = @_;
+     my ($table_comment) = $self->schema->storage->dbh->selectrow_array(
+        q{SELECT obj_description(oid) 
+            FROM pg_class 
+            WHERE relname=? AND relnamespace=(
+                SELECT oid FROM pg_namespace WHERE nspname=?)
+        }, undef, $table, $self->db_schema
+        );   
+    return $table_comment
+}
+
+
+sub _column_comment {
+    my ( $self, $table, $column_number ) = @_;
+     my ($table_oid) = $self->schema->storage->dbh->selectrow_array(
+        q{SELECT oid
+            FROM pg_class 
+            WHERE relname=? AND relnamespace=(
+                SELECT oid FROM pg_namespace WHERE nspname=?)
+        }, undef, $table, $self->db_schema
+        );   
+    return $self->schema->storage->dbh->selectrow_array('SELECT col_description(?,?)', undef, $table_oid,
+    $column_number );
+}
+
 sub _extra_column_info {
     my ($self, $info) = @_;
     my %extra_info;
@@ -111,6 +138,15 @@ sub _extra_column_info {
 L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
 L<DBIx::Class::Schema::Loader::DBI>
 
+=head1 AUTHOR
+
+See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
 =cut
 
 1;