[Dbix-class] Re: Explicit class naming

Dagfinn Ilmari Mannsåker ilmari at ilmari.org
Wed Feb 13 17:45:28 GMT 2013


Dag-Erling Smørgrav <des at des.no> writes:

> I have a sneaking suspicion that this is a FAQ, but I can't find the
> answer anywhere.
>
> I have a schema where some of the table names are acronyms, and I'd like
> dbicdump to create classes with all-caps names for those tables.  For
> instance, I have a table named "mac", and I'd like the class to be named
> MAC rather than Mac.  Is there a way to force the class name, perhaps by
> passing a hash to DBIx::Schema::Loader that maps the (case insensitive)
> table name to a (case sensitive) class name?

This is exactly what the moniker_map option is for:

<https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#moniker_map>

-- 
"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 mailing list