Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbicx::testdatabase::subclass(3pm) [debian man page]

DBICx::TestDatabase::Subclass(3pm)			User Contributed Perl Documentation			DBICx::TestDatabase::Subclass(3pm)

NAME
DBICx::TestDatabase::Subclass - a DBICx::TestDatabase you can add your own methods to SYNOPSIS
Your test database subclass: package MyApp::TestDatabase use base qw(DBICx::TestDatabase::Subclass MyApp::Schema); sub foo { my $self = shift; return $self->resultset('Foo')->create({ foo => 'bar' }); } Later: use MyApp::TestDatabase; my $schema = MyApp::TestDatabase->connect; my $foo_row = $schema->foo; # MyApp::TestDatabase::foo my $bars = $schema->resultset('Bar'); # MyApp::Schema::resultset DESCRIPTION
Sometimes DBICx::TestDatabase doesn't give you enough control over the object returned. This module lets you create a custom test database class. METHODS
connect This method creates the temporary database and returns the connection. If your subclass needs to change the way connect works, do something like this: sub connect { my ($class) = @_; say 'This happens before we create the test database.'; my $schema = $class->next::method; say '$schema is the temporary test database'; return $schema; } SEE ALSO
If you want a simple test database based on a DBIC schema, just use DBICx::TestDatabase. AUTHOR
Jonathan Rockway "<jrockway@cpan.org>" LICENSE
Copyright (c) 2007 Jonathan Rockway. This program is free software. You may use, modify, and redistribute it under the same terms as Perl itself. perl v5.10.1 2007-10-07 DBICx::TestDatabase::Subclass(3pm)

Check Out this Related Man Page

DBICADMIN(1)						User Contributed Perl Documentation					      DBICADMIN(1)

NAME
dbicadmin - utility for administrating DBIx::Class schemata SYNOPSIS
dbicadmin: [-I] [long options...] deploy a schema to a database dbicadmin --schema=MyApp::Schema --connect='["dbi:SQLite:my.db", "", ""]' --deploy update an existing record dbicadmin --schema=MyApp::Schema --class=Employee --connect='["dbi:SQLite:my.db", "", ""]' --op=update --set='{ "name": "New_Employee" }' OPTIONS
Actions --create Create version diffs needs preversion --upgrade Upgrade the database to the current schema --install Install the schema version tables to an existing database --deploy Deploy the schema to the database --select Select data from the schema --insert Insert data into the schema --update Update data in the schema --delete Delete data from the schema --op compatibility option all of the above can be supplied as --op=<action> --help display this help Arguments --config-file or --config Supply the config file for parsing by Config::Any --connect-info Supply the connect info as trailing options e.g. --connect-info dsn=<dsn> user=<user> password=<pass> --connect Supply the connect info as a JSON-encoded structure, e.g. an --connect=["dsn","user","pass"] --schema-class The class of the schema to load --config-stanza Where in the config to find the connection_info, supply in form MyApp::Model::DB --resultset or --resultset-class or --class The resultset to operate on for data manipulation --sql-dir The directory where sql diffs will be created --sql-type The RDBMs flavour you wish to use --version Supply a version install --preversion The previous version to diff against --set JSON data used to perform data operations --attrs JSON string to be used for the second argument for search --where JSON string to be used for the where clause of search --force Be forceful with some operations --trace Turn on DBIx::Class trace output --quiet Be less verbose -I Same as perl's -I, prepended to current @INC AUTHORS
See "CONTRIBUTORS" in DBIx::Class LICENSE
You may distribute this code under the same terms as Perl itself perl v5.18.2 2014-01-30 DBICADMIN(1)
Man Page