__PACKAGE__->mk_group_accessors('simple' => qw/_ordered_columns
_columns _primaries _unique_constraints name resultset_attributes
- schema from _relationships/);
+ schema from _relationships column_info_from_storage/);
__PACKAGE__->mk_group_accessors('component_class' => qw/resultset_class
result_class source_name/);
unless exists $self->_columns->{$column};
#warn $self->{_columns_info_loaded}, "\n";
if ( ! $self->_columns->{$column}{data_type}
+ and $self->column_info_from_storage
and ! $self->{_columns_info_loaded}
and $self->schema and $self->storage )
{
return $self->_columns->{$column};
}
+=head2 load_column_info_from_storage
+
+Enables the on-demand automatic loading of the above column
+metadata from storage as neccesary.
+
+=cut
+
+sub load_column_info_from_storage { shift->column_info_from_storage(1) }
+
=head2 columns
my @column_names = $obj->columns;
return $self->result_source_instance->column_info($column);
}
+sub load_column_info_from_storage {
+ shift->result_source_instance->load_column_info_from_storage;
+}
sub columns {
return shift->result_source_instance->columns(@_);
# test column_info
{
$schema->source("Artist")->{_columns}{'artistid'} = {};
+ $schema->source("Artist")->load_column_info_from_storage;
my $typeinfo = $schema->source("Artist")->column_info('artistid');
is($typeinfo->{data_type}, 'INTEGER', 'column_info ok');
__PACKAGE__->load_components(qw/PK::Auto Core/);
__PACKAGE__->table('casecheck');
__PACKAGE__->add_columns(qw/id name NAME uc_name/);
+ __PACKAGE__->load_column_info_from_storage;
__PACKAGE__->set_primary_key('id');
}