File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
lib/DBIx/Class/Schema/Loader Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,17 @@ a coderef for a translator function taking a L<table
614614object|DBIx::Class::Schema::Loader::Table> argument (which stringifies to the
615615unqualified table name) and returning a scalar moniker
616616
617+ For Example:
618+
619+ Some databases like to prefix a namespace to every table definition
620+ (e.g. Microsoft SQL Server likes to add 'dbo'). To avoid having your classes
621+ contain redundant information you can pass C<moniker_map > a function to strip it off.
622+
623+ moniker_map => sub { my $name = $_[0];
624+ $name =~ s/^dbo//;
625+ join '', map ucfirst, split '_', $name
626+ }
627+
617628The function is also passed a coderef that can be called with either
618629of the hashref forms to get the moniker mapped accordingly. This is
619630useful if you need to handle some monikers specially, but want to use
You can’t perform that action at this time.
0 commit comments