No subject


Sun Nov 20 20:48:46 GMT 2022


```
Hi Vadim,

"Pushtaev Vadim via RT" <bug-DBIx-Class-Schema-Loader at rt.cpan.org>
writes:

> Hi!
>
> Since the last update, DBIx::Class::Schema::Loader automatically
> creates `view_definition` for views. In case of MySQL it uses `SELECT
> view_definition FROM information_schema.views ...` query and the
> result of this query contains the database name along with every table
> name: `project`.`user` instead of just `user`.

Schema::Loader does deliberately not do anything with the view
definition SQL, since that would require a fully-fledged SQL parser.
This is incidentally why it does not introspect the view definition for
DB2, since that only gives you the whole CREATE VIEW statement, not the
body separately.

> It's a big issue for our project since different users and
> environments use different database names. It would be great to have
> view definition without database name or at least disable
> view_definition generation at all.

For non-virtual views, the view definition is only used for ->deploy.
The fact that you're happy with not having it generated at all makes it
seem to me that you're not using deploy, so the definition is purely
informative.

If you really need it, you can add an sqlt_deploy_hook method to the
result class that modifies $view->sql as appropriate for your specific
case.

Hope this helps,

Ilmari

-- 
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live with
 the consequences of."                              -- Skud's Meta-Law
```



More information about the DBIx-Class-Devel mailing list