Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Stash Moose objects in a DBIx::NoSQL SQLite database

branch: releases

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 xt
Octocat-spinner-32 AUTHOR_PLEDGE
Octocat-spinner-32 Build.PL
Octocat-spinner-32 Changes
Octocat-spinner-32 INSTALL
Octocat-spinner-32 LICENSE
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 META.json
Octocat-spinner-32 META.yml
Octocat-spinner-32 README
Octocat-spinner-32 README.mkdn
Octocat-spinner-32 SIGNATURE
README.mkdn

NAME

DBIx::NoSQL::Store::Manager - DBIx::NoSQL as a Moose object store

VERSION

version 0.1.1

SYNOPSIS

package MyStore;

use Moose;

extends 'DBIx::NoSQL::Store::Manager';

__PACKAGE__->meta->make_immutable;

DESCRIPTION

Just like DBIx::NoSQL is a layer providing the flexibility of a NoSQL store on top of DBIx::Class, DBIx::NoSQL::Store::Manager provides a mechanism to drop and retrieve Moose objects from that store.

As can be seen in the SYNOPSIS, the store class itself is typically fairly bare; most of the work is done by DBIx::NoSQL::Store::Manager::Model, the role the models (i.e., the classes to be stored in the database) must consume.

DBIx::NoSQL::Store::Manager extends DBIx::NoSQL and inherits all its methods.

METHODS

new( models => \@classes )

Creates a new store manager.

Arguments

  • models => \@classes =item models => $class

Classes to be imported as models for the store. Namespaces can also be given with a trailing ::, in which case all modules found under that namespace will be imported. If only one class is to be used, it can be passed as a single string.

If not given, defaults to the Model sub-namespace under the store's (e.g., for store class MyStore, that would be MyStore::Model::).

my $store = MyStore->new; 
    # will import MyStore::Model::*


my $store = MyStore->new( models => [ 'Foo::Bar', 'Something::Else' ] );
    # imports specific classes


my $store = MyStore->new( models => [ 'Foo::Bar', 'MyStore::Model::' ] );
    # imports Foo::Bar and all classes under MyStore::Model::*

model_names()

Returns the name of all models known to the store.

model_classes()

Returns the full class name of all models known to the store.

model_class( $name )

Returns the full class name of the given model.

new_model_object( $model_name, @args )

Shortcut constructor for a model class of the store. Equivalent to

my $class = $store->model_class( $model_name );
my $thingy = $class->new( store_db => $store, @args );

SEE ALSO

Similar Modules

AUTHOR

Yanick Champoux yanick@babyl.dyndns.org

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Something went wrong with that request. Please try again.