Is it possible to change the definition of a
DBIx::Class::ResultSource::View based on the particular database to
which a connection is made?

I have a result class that is a union of several tables. Unfortunately,
I now have another database to which I must connect that has an
additional table needing to be included in the union. Is it possible to
do this by connecting to the database and then changing the result class
somehow to use the expanded union?

My class initializes with:

__PACKAGE__->result_source_instance->is_virtual(1);
__PACKAGE__->result_source_instance->view_definition($my_select_union_sql);

I've tried adding a call later, once I know which database is in use:

__PACKAGE__->result_source_instance->view_definition($my_new_select_union_sql);

but DBIC still uses the original select SQL when querying the database.

Is there some other way of changing the definition of the view?

Thanks, Dave

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to