Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MyApp::Schema;
- sub new_schema {
- __PACKAGE__->connect(...)
- }
- package MyCatApp::Model::MyApp;
- use Moose;
- extends 'Catalyst::Model::DBIC::Schema';
- ## what here;
- _PACKAGE__->make_immutable;
- <Model::MyApp>
- schema_class MyApp::Schema
- traits Caching
- user_defined_schema_accessor foo
- </Model::MyApp>
- __PACKAGE__->config('schema_class', MyApp::Schema->new_schema)
- __PACKAGE__->config('schema_class', MyApp::Schema->new_schema)
- subtype SchemaClass,
- as LoadableClass,
- where { $_->isa('DBIx::Class::Schema') };
- has schema_class => (
- is => 'ro',
- isa => 'Object',
- required => 1
- );
- __PACKAGE__->config(
- schema_class => 'MyApp::Schema',
- connect_info => {
- dsn => 'dbi:Pg:dbname=mypgdb',
- user => 'postgres',
- password => '',
- pg_enable_utf8 => 1,
- on_connect_do => [
- 'some SQL statement',
- 'another SQL statement',
- ],
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement