Created
July 1, 2010 20:52
-
-
Save domm/460542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub kiokudb_handle { | |
my $self = shift; | |
croak "Can't call kiokudb_handle on unconnected schema" unless ref $self; | |
unless ( $self->{kiokudb_handle} ) { | |
require KiokuDB; | |
require KiokuDB::Backend::DBI; | |
my $dir = KiokuDB->new( | |
backend => my $backend = KiokuDB::Backend::DBI->new( | |
connected_schema => $self, | |
), | |
); | |
$backend->meta->get_attribute('schema')->_weaken_value($backend); # FIXME proper MOP api? | |
# not weak | |
$self->{kiokudb_handle} = $dir; | |
unless ( $self->kiokudb_entries_source_name ) { | |
$self->define_kiokudb_schema( extra_entries_columns => $backend->columns ); | |
} | |
} | |
$self->{kiokudb_handle}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment