Add custom_column_info implemenation
Robert Bohne [Mon, 15 Feb 2010 12:25:11 +0000 (13:25 +0100)]
lib/DBIx/Class/Schema/Loader/Base.pm
lib/DBIx/Class/Schema/Loader/DBI.pm

index 2956ca9..c74ec50 100644 (file)
@@ -32,6 +32,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/
                                 skip_relationships
                                 skip_load_external
                                 moniker_map
+                                custom_column_info
                                 inflect_singular
                                 inflect_plural
                                 debug
@@ -1523,6 +1524,16 @@ sub _quote_table_name {
 
 sub _is_case_sensitive { 0 }
 
+sub _custom_column_info {
+    my ( $self, $info ) = @_;
+
+    if( ref $self->custom_column_info eq 'HASH' ) {
+        
+    } elsif( ref $self->custom_column_info eq 'CODE' ) {
+        return $self->custom_column_info->($info);
+    }
+}
+
 # remove the dump dir from @INC on destruction
 sub DESTROY {
     my $self = shift;
index ba314ee..0dd5c3f 100644 (file)
@@ -289,8 +289,8 @@ sub _columns_info_for {
                 $col_name =~ s/^\"(.*)\"$/$1/;
 
                 my $extra_info = $self->_extra_column_info($info) || {};
-
-                $result{$col_name} = { %column_info, %$extra_info };
+                my $custom_info = $self->_custom_column_info($info) || {};
+                $result{$col_name} = { %column_info, %$extra_info, %$custom_info };
             }
             $sth->finish;
         };