Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

ModelSEED Database Composite

Scott Devoid edited this page Jun 29, 2012 · 3 revisions

ModelSEED::Database::Composite

A composite implementation of the ModelSEED::Database interface.

Methods

new

my $db = ModelSEED::Database::Composite->new(\%);

This initializes a Storage interface object. This accepts a hash reference to configuration details. Currently this only accepts two parameters:

databases

An array reference (\@) where each element in the array is either a ModelSEED::Database implementation or a hash reference (\%) like the following:

{
    class => "ModelSEED::Database::*"
    ...
}

class must be a valid class that implements the ModelSEED::Database role. All other attributes are used as arguments to the constructor for that class.

use_config

A boolean flag. If this is set, use the configuration details in ModelSEED::Configuration under the "stores" key as arguments like in databases.

Concepts

Since this acts as a composite over a number of database instances, it behaves a little differently from a standard ModelSEED::Database implementation. For most "read" functions, this class simply calls those functions on each database in it's composite. However, some functions will stop searching after they find a result. For "write" functions, e.g. save_object, it will call this on all databases in the composite.

List of "read" functions:

has_data *
get_data *
get_data *
find_data
get_aliases 
alias_viewers *
alias_owner   *
alias_public  *

Note that any function with a (*) stops searching after it finds results. So, for example has_object may not query all databases.

List of "write" functions:

save_data
delete_data

create_alias
update_alias
add_viewer
remove_viewer
set_public

Methods

See ModelSEED::Database for methods.