tomgracey has asked for the wisdom of the Perl Monks concerning the following question:
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...?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how can I figure out what moniker DBIx::Class::Schema::Loader used for a given table?
by Your Mother (Archbishop) on Dec 29, 2017 at 04:12 UTC | |
by tomgracey (Scribe) on Dec 29, 2017 at 11:10 UTC | |
|
Re: how can I figure out what moniker DBIx::Class::Schema::Loader used for a given table?
by 1nickt (Canon) on Dec 29, 2017 at 01:10 UTC | |
by tomgracey (Scribe) on Dec 29, 2017 at 02:16 UTC | |
by 1nickt (Canon) on Dec 29, 2017 at 03:28 UTC |