--- /dev/null
+use strict;
+use warnings;
+
+package Catalyst::TraitFor::Model::DBIC::Schema::SharedDatabaseConnection;
+
+use Moose::Role;
+
+has parent_model => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1,
+);
+
+has cloned => (
+ is => 'rw',
+ default => 0,
+);
+around ACCEPT_CONTEXT => sub {
+ my ( $orig, $self, $app, @rest ) = ( shift, shift, @_ );
+ unless ( $self->cloned ) {
+ $self->schema->storage(
+ $app->model( $self->parent_model )->schema->storage );
+ $self->cloned(1);
+ }
+ $self->$orig( $app, @rest );
+};
+
+no Moose::Role;
+1;