Hello Monks

I only ever ask stupid questions so apologies in advance for this!

So the problem is this: I have a process which adds some tables to a database. The user is able to specify a prefix which will be applied to all table names in the set (so in a sense these have dynamic names). Then via a second process I allow the user to create a schema using DBIx::Class::Schema::Loader, using custom options.

Next I want to use that schema. The question is, how can I figure out what moniker DBIx::Class::Schema::Loader used to create the schema file for a given table? I mean I know the original table name and options that were passed to make_schema_at, and I'm looking for something like

my $moniker = DBIx::Class::Schema::Loader->moniker_of_table( $table_name, \%orig_load_options );

(Obviously it's probably not going to be quite as convenient as this, but you get the idea!)

I did notice a _table2moniker method while looking over the DBIx::Class::Schema::Loader::Base code - but I can't seem to find anything intended for public use. (The moniker creation code looks pretty complex...)

Can someone point me in the right direction...?


In reply to how can I figure out what moniker DBIx::Class::Schema::Loader used for a given table? by tomgracey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.